This commit adds support for handling an empty request body with both HttpEntity where the body is not required and with @RequestBody where the body is required depending on the annotation's required flag. If the body is an explicit type (e.g. String, HttpEntity<String>) and the body is required an exception is raised before the method is even invoked or otherwise the body is passed in as null. If the body is declared as an async type (e.g. Mono<String>, HttpEntity<Mono<String>>) and is required, the error will flow through the async type. If not required, the async type will be passed with no values (i.e. empty). A notable exception is rx.Single which can only have one value or one error and cannot be empty. As a result currently the use of rx.Single to represent the request body in any form effectively implies the body is required.
Spring Reactive is a sandbox for experimenting on the reactive support intended to be part of Spring Framework 5. For more information about this topic, you can have a look to Intro to Reactive programming and Reactive Web Applications talks.
Downloading Artifacts
Spring Reactive JAR dependency is available from Spring snapshot repository:
- Repository URL:
https://repo.spring.io/snapshot/ - GroupId:
org.springframework.reactive - ArtifactId:
spring-reactive - Version:
0.1.0.BUILD-SNAPSHOT
Documentation
See the current Javadoc.
Sample application
Spring Reactive Playground is a sample application based on Spring Reactive and on MongoDB, Couchbase and PostgreSQL Reactive database drivers.
Building from Source
Spring Reactive uses a Gradle-based build system. In the instructions
below, ./gradlew is invoked from the root of the source tree and serves as
a cross-platform, self-contained bootstrap mechanism for the build.
You can check the current build status on this Bamboo Spring Reactive build.
Prerequisites
Git and JDK 8 update 20 or later
Be sure that your JAVA_HOME environment variable points to the jdk1.8.0 folder
extracted from the JDK download.
Install all spring-* jars into your local Maven cache
./gradlew install
Compile and test; build all jars, distribution zips, and docs
./gradlew build
Contributing
Feel free to send us your feedback on the issue tracker; Pull requests are welcome.
License
The Spring Reactive is released under version 2.0 of the Apache License.