Commit Graph

502 Commits

Author SHA1 Message Date
Sebastien Deleuze ae4b35ced7 Add Mono and Flux support in @RequestMapping handler methods 2016-01-11 13:02:36 +01:00
Rossen Stoyanchev 1faeb0ec87 Add HttpCookie + server support through HttpHeaders 2016-01-10 22:36:45 -05:00
Rossen Stoyanchev f8ef2e0220 Add base classes for ServerHttpRequest/Response impls 2016-01-10 15:46:56 -05:00
Rossen Stoyanchev eedc90818f Re-introduce writeHeaders() in ServerHttpResponse
This commit brings back the writeHeaders method on ServerHttpResponse
that was once added (2a6a4f) and then removed (9c7151).

This version is a little simpler since writeHeaders doesn't explicitly
flush/send headers which runtimes are expected to do by default.
Instead the main purpose of writeHeaders now is to ensure changes made
via HttpHeaders are applied to the underlying runtime response at some
point and we now do that once at the very end.

This approach provides the most flexibility (vs keeping HttpHeaders in
sync) because it allows a full and consistent set of mutative
operations for both headers and cookies (to be added) regardless of the
API exposed by the underlying runtime.
2016-01-10 06:25:12 -05:00
Rossen Stoyanchev 4f614fa0fd Add WebServerExchange
This change adds a WebServerExchange and updates all contracts at the
the same level (i.e. org.springframework.web.server) as well as the
org.springframework.web.reactive level to use it so that all
framework-related code will have access to server-side processing
features such as request attributes (and others to come).
2016-01-08 12:30:13 -05:00
Rossen Stoyanchev 54e4e012b2 Separate out web.server from http.server.reactive
This change separates out lower-level HTTP adapter code from the more
(framework-specific) HTTP processing into a separate package under
org.springframework.web.server (not under org.springframework.http).
2016-01-08 12:29:04 -05:00
Stephane Maldini 94be412327 Remove last Stream reference 2016-01-07 23:41:48 +00:00
Stephane Maldini b4c3a67d2c Use Stream instead of Streams and uncomment reactor test 2016-01-07 23:29:16 +00:00
Rossen Stoyanchev 97af9998d5 Refine exception handling
Refine exception handling responsibilities between the
DispatcherHandler and the HandlerAdapter.
2016-01-07 18:26:27 -05:00
Stephane Maldini 70b8848492 fix Streams to Stream in test 2016-01-07 22:28:35 +00:00
Rossen Stoyanchev 9a1492e401 Polish 2016-01-07 17:09:49 -05:00
Rossen Stoyanchev a712f43654 Polish 2016-01-07 15:26:11 -05:00
Rossen Stoyanchev c3a8bf4d17 Revert "Remove mandatory dependency on Reactor Stream"
This reverts commit d5e6f70483d4a6c8af3cc5e97e52a54e98199169.
2016-01-07 15:23:55 -05:00
Sebastien Deleuze 318092cfd0 Use Mono#defaultIfEmpty instead of Flux#defaultIfEmpty 2016-01-07 15:58:46 +01:00
Sebastien Deleuze 327c420409 Remove mandatory dependency on Reactor Stream with JarJar 2016-01-07 14:51:43 +01:00
Sebastien Deleuze 8ef7e2ff77 Use Reactor 2.5 Flux and Mono Rx light API
Flux and Mono are used both for implementation and exposed at API
level to express 1 versus N semantic and to provide default Rx
operators:
- Flux<T> for multiple values Publisher (issue #48)
- Mono<T> for single value Publisher (issue #50)
- Mono<Void> for Publisher with no value (issue #49)
2016-01-07 11:14:12 +01:00
Rossen Stoyanchev 8ef2ce44f4 Temporarily remove Reactor from integration tests
https://github.com/spring-projects/spring-reactive/issues/57
2015-12-31 13:18:13 -05:00
Rossen Stoyanchev 0aade73c88 Update Servlet + Undertow req & resp implementations
For those runtimes that don't directly support Reacitve Streams this
commit separates more formally Reactive Streams bridge code out of
the request and response implementations which become simple adapters
to the ServerHttpRequest/Response contracts like their RxNetty and
Reactor Net counterparts.
2015-12-31 12:55:09 -05:00
Rossen Stoyanchev 869f6bef40 Polish server request & response implementations 2015-12-31 12:27:40 -05:00
Rossen Stoyanchev 6b05d17248 Response headers always in sync with native response
ServerHttpResponse implementations now immediately propagate
HttpHeaders changes as they so there is no need to call applyHeaders().

The writeHeaders from ServerHttpResponse is also removed. RxNetty and
Reactor Net both support implicitly completing if the handler
completes without explicitly writing the headers or the response body.
2015-12-29 23:13:21 -05:00
Rossen Stoyanchev 34eb6d5426 Add support for @ExceptionHandler methods 2015-12-29 23:13:21 -05:00
Rossen Stoyanchev 8c89b478d9 Add operator for deferred writes 2015-12-29 23:13:21 -05:00
Rossen Stoyanchev 9789db23d2 Rename HandlerResult fields from value to result 2015-12-29 23:13:21 -05:00
Rossen Stoyanchev 84e3ad342b Remove @Ignore from 404 status code tests 2015-12-29 23:13:21 -05:00
Rossen Stoyanchev 9eb07b7780 Update package for reactor Signal 2015-12-29 23:13:21 -05:00
Rossen Stoyanchev a12c172ceb Switch to rxnetty-http dependency
The "rxnetty" artifact is old (October 2015). There is now rxnetty-http
and other modules that have more recent snapshots (December 2015).
2015-12-29 23:13:21 -05:00
Stephane Maldini da4e4aab39 test operator log 2015-12-18 16:56:17 +00:00
Stephane Maldini 15185c75a3 use Publishers.onErrorResumeNext 2015-12-17 13:34:09 +00:00
Rossen Stoyanchev 69973d984d Fix test failure 2015-12-16 12:30:15 -05:00
Rossen Stoyanchev 623874b4d0 Constant HandlerNotFoundException 2015-12-16 11:08:41 -05:00
Rossen Stoyanchev 1b3289d0d5 Add InternalServerErrorExceptionHandler 2015-12-15 17:04:53 -05:00
Rossen Stoyanchev f2cd92a243 Fix imports 2015-12-15 12:09:23 -05:00
Rossen Stoyanchev c13a8c9bb4 DispatcherHandler maps errors to ResponseStatusException
The DispatcherHandler now has an errorMapper property that is a
function for transforming errors. By default this property is set to an
instance of DispatcherHandlerExceptionMapper which wraps "standard"
framework exceptions and @ResponseStatus-annotated exceptions as
ResponseStatusException.

This makes it easy to handle the exceptions downstream uniformly.
2015-12-15 12:08:13 -05:00
Rossen Stoyanchev 1f15b7e074 Add ResponseStatusException
This change adds a ResponseStatusException to associate an exception
with a status code at runtime. Along with that is an
ResponseStatusExceptionHandler that handles ResponseStatusException
by setting the response status.
2015-12-15 12:06:53 -05:00
Rossen Stoyanchev 5231e7da7b Fix failing test 2015-12-10 16:50:28 -05:00
Rossen Stoyanchev a0018d13e1 Add DispatcherHandlerErrorTests
The tests demonstrate failures at various phases of request processing
and the resulting error signals.
2015-12-10 16:35:40 -05:00
Rossen Stoyanchev 4ba3d0736f Add HttpExceptionHandler 2015-12-10 16:35:40 -05:00
Rossen Stoyanchev 448aac813a Add MockServerHttpRequest/Response 2015-12-10 16:35:40 -05:00
Sebastien Deleuze 78454f5a2e Add a link to Spring Reactive Playground 2015-12-09 11:18:50 +01:00
Rossen Stoyanchev ef3560a55a Add HttpHandlerDecorator and fix test package 2015-12-08 22:50:25 -05:00
Rossen Stoyanchev 1dcaff8a5c Updates to Javadoc 2015-12-08 22:50:24 -05:00
Stephane Maldini fbb0c702c9 minor reactor server impl to fulfill core introspection 2015-12-09 01:58:53 +00:00
Rossen Stoyanchev ad4be9462b Drop use of WebApplicationContext in tests
It brings along Servlet imports.
2015-12-08 14:33:23 -05:00
Stephane Maldini 4616938525 Prepare for a future change to downstream() inner method in reactor-core 2015-12-08 13:21:35 +00:00
Rossen Stoyanchev 45706422dd InvocableHandlerMethod and arg resolution updates
General improvements e.g. make use of Java 8 Stream. The main reason
for the refactoring however to tighten error handling. To that extent:

InvocableHandlerMethod turns all exceptions into Reactive Streams
error signals, in effect never allowing any Exceptions to bubble up.

HandlerMethodArgumentResolver may throw an Exception for sync resolution
or produce an error signal via the returned Publisher. Either way the
exception is consistently wrapped with helpful method argument details.
For the latter case using a custom mapError operator.

HandlerMethodArgumentResolver no longer needs to return Optional for
nullable argument values. Instead (for now) the defaultIfEmpty operator
of reactor.rx.Stream operator is used to ensure a default constant value
(called "NO_VALUE") is produced. That way an argument resolver may
produce 0..1 values where 0 means it did not resolve to any value and
that results in null passed as the argument value.

If a HandlerMethodArgumentResolver produces more than one value, all
additional values beyond the first one will be ignored with the help
of a custom "first" operator.

As HandlerMethod is invoked within the map operator, checked exceptions
are not allowed but instead of wrapping it in a runtime exception what
we really need is to unwrap the target exception for exception
resolution purposes. To this end concatMap is used to produce a nested
Publisher or an error Publisher with the unwrapped target exception.

Related to that InvocableHandlerMethod now returns
Publisher<HandlerResult> instead of Publisher<Object> so that no longer
needs to be externally mapped from Object to HandlerResult.

InvocableHandlerMethodTests provides tests for the above scenarios and
verifies the details of resulting error signals.
2015-12-07 17:36:58 -05:00
Sebastien Deleuze ce0bd2efc2 Improve Gradle dependencies version management
This commit also updates to the following dependencies:
 - Spring Framework 4.2.3.RELEASE
 - RxJava 1.1.0
2015-12-07 11:35:00 +01:00
Rossen Stoyanchev da98becf72 Move http.server to http.server.reactive 2015-12-02 17:46:07 -05:00
Rossen Stoyanchev 382c98f968 Remove isolated use of Reactor Buffer 2015-12-01 18:19:14 -05:00
Rossen Stoyanchev df80ffbf28 Spring-consistent naming in server.http package
This change also removes reactor-stream variants of the request and
response since the request and response aren't used directly by
application code and get passed through reactor.Publishers anyway.
2015-12-01 18:09:53 -05:00
Stephane Maldini b9a52d5f7c Change to Definitive generic signature for Publishers.zip 2015-12-01 16:51:52 +00:00
Stephane Maldini 9ce5c7416b compiler issue ? 2015-12-01 15:01:34 +00:00
Rossen Stoyanchev 71d1d11fac Non-blocking HandlerMapping chain 2015-12-01 07:34:35 -05:00
Stephane Maldini b26e746120 Use Publishers.zip instead of Streams.zip 2015-12-01 10:43:41 +00:00
Sebastien Deleuze 91c2b7afad Support handler methods returning void, Observable<Void>, etc. 2015-11-30 15:35:58 +01:00
Rossen Stoyanchev 57dc8199fb Add ReactiveHttpFilter 2015-11-25 13:11:01 -05:00
Sebastien Deleuze 0f8a4bf706 Polish imports 2015-11-25 10:42:23 +01:00
Sebastien Deleuze b18919d111 Improve Javadoc for HandlerAdapter and HandlerMapping 2015-11-25 10:35:09 +01:00
Rossen Stoyanchev d319edba28 HandlerMapping is now asynchronous 2015-11-24 17:36:44 -05:00
Sebastien Deleuze dc57e2621c Move HttpServer related classes back to src/main/java
This is needed in order to be able to use Spring Reactive in standalone
applications. These are temporary classes that will return in
src/test/java when Spring Boot support for Reactive applications will
be implemented.
2015-11-24 18:11:44 +01:00
Rossen Stoyanchev 4a3c0bc3b6 Remove top-level org.springfamework.reactive package
reactive.codec -> core.codec
reactive.io    -> util

These may very well not be the final locations. For now they simply
express that there are classes that belong somewhere in core, i.e.
they are lower level dependencies than web.
2015-11-22 15:02:18 -05:00
Rossen Stoyanchev 911d376922 Improve MimeType -> MediaType handling
This change adds an Encoder-to-MediaType lookup in
ResponseBodyResultHandler to avoid MimeType to MediaType creation at
runtime.
2015-11-22 14:41:59 -05:00
Rossen Stoyanchev 8d30722f21 Remove @MVC test with multiple matches
RequestMappingHandlerMapping currently picks the first match and does
have logic to deal with selecting the best match. This caused a
random test failure depending on which controller method was matched
first. This change removes the test.
2015-11-20 13:17:10 -05:00
Rossen Stoyanchev e9e4bcdc59 Move ~.web.reactive.server to ~.http.server 2015-11-20 13:10:44 -05:00
Rossen Stoyanchev 81867fa423 Refactor package structure for web
The web related code is now under org.springframework.web.reactive.
This is parallel to org.springframework.web (the top-level package of
spring-webmvc).
2015-11-13 17:49:31 -05:00
Rossen Stoyanchev 54ce20a5e0 Rename field in HandlerResult 2015-11-13 17:23:00 -05:00
Sebastien Deleuze c6713c23e3 Add a ResolvableType field to HandlerResult
This change allows to be able to check generic type on the return value
at HandlerAdapter and ResultHandler level. For example, it allows to do
a Publisher<Void> check in SimpleHandlerResultHandler.
2015-11-13 17:09:02 -05:00
Rossen Stoyanchev 5d4201d500 Fix "Content-Type" and "Accept" header processing
"Content-Type" is just a single MediaType.

For the response, the MediaType must be fully selected before
selecting and encoder.

The ResponseBodyResultHandler now includes actual content negotiation
with a potential 406 response.
2015-11-13 16:47:52 -05:00
Rossen Stoyanchev 2de127ad4a Polish 2015-11-13 15:55:50 -05:00
Sebastien Deleuze bdc5b38cb1 Refactor codecs
This commit introduces the following changes:
 - MessageToByteEncoder/Decoder renamed to Encoder/Decoder
 - JsonObjectEncoder/Decoder are now used directly in
   JacksonJsonEncoder/Decoder
 - Codec uses MimeType instead of MediaType since they
   are not specific to HTTP
 - Default MimeType are now managed thanks to
   Encoder/Decoder#getSupportedMimeTypes()
 - AbstractEncoder/Decoder takes care of generic MimeType related behavior
2015-11-13 15:01:02 -05:00
Rossen Stoyanchev 141d75791d Polish 2015-11-12 11:52:06 -05:00
Marek Hawrylczak f1bec5f1e4 referencing fields of a class using this 2015-11-07 16:37:40 +01:00
Marek Hawrylczak 9126fd9dec Indentation using tabs 2015-11-07 16:02:09 +01:00
Marek Hawrylczak 4c84117155 undertow support using non-blocking API’s 2015-11-07 15:52:47 +01:00
Rossen Stoyanchev a48c9b6305 Replace DefaultConversionService in spring-reactive 2015-10-30 17:58:59 -04:00
Rossen Stoyanchev c0dff3d2bb Comply with Spring Framework code style
https://github.com/spring-projects/spring-framework/wiki/Spring-Framework-Code-Style
2015-10-30 17:22:19 -04:00
Rossen Stoyanchev 0989c8b3c2 HandlerMethodArgumentResolver is now asynchronous 2015-10-30 16:04:49 -04:00
Rossen Stoyanchev 6b73993a38 HandlerAdapter is asynchronous again 2015-10-30 15:02:54 -04:00
Sebastien Deleuze 01ae961820 Make DefaultConversionService usable by the upcoming client 2015-10-30 11:03:49 +01:00
Sebastien Deleuze a257a4a37d Polishing 2015-10-30 11:02:40 +01:00
Arjen Poutsma b2bf18dd3d Removed Closeable implementation 2015-10-30 09:39:46 +01:00
Arjen Poutsma 5f2e958fae Removed IOException declaration 2015-10-30 09:38:29 +01:00
Arjen Poutsma bd472af37e Updated Copyright notices 2015-10-30 09:26:34 +01:00
Arjen Poutsma 6006fa6ec2 Optimized imports 2015-10-30 09:24:53 +01:00
Arjen Poutsma e121f7ecd4 Improved documentation on setBody() 2015-10-29 16:44:13 +01:00
Arjen Poutsma 45a88974bc Changed addBody() to setBody() 2015-10-29 16:28:22 +01:00
Arjen Poutsma 5727abc82d Resolved merge conflicts 2015-10-29 16:08:10 +01:00
Arjen Poutsma bab3b6fd1c Introduce HttpMessage hierarchy
This commit introduces "reactive" sub-interfaces of the HttpMessage
interface found in the Spring Framework.
2015-10-29 15:45:28 +01:00
Stephane Maldini 3864fc24ff Fix JSON encoding issue 2015-10-29 11:10:38 +01:00
Stephane Maldini fd52ae999b Update to latest reactor-net
Latest reactor-net doesn't depend on reactor-stream anymore (neither reactor-codec and reactor-bus, it only depends on reactor-core).
2015-10-29 11:10:19 +01:00
Sebastien Deleuze adc50bbfb9 Add handler method parameter and result converters
This commit introduces the following changes:
 - Publisher -> Observable/Stream/etc. conversion is now managed
    in a dedicated ConversionService instead of directly in
    RequestBodyArgumentResolver and ResponseBodyResultHandler
 - More isolated logic that decides if the stream should be
    serialized as a JSON array or not
 - Publisher<ByteBuffer> are now handled by regular
   ByteBufferEncoder and ByteBufferDecoder
 - Handle Publisher<Void> return value properly
 - Ensure that the headers are properly written even for response
   without body
 - Improve JsonObjectEncoder to autodetect JSON arrays
2015-10-29 10:50:06 +01:00
Sebastien Deleuze cf2c1514af Use latest Reactor core capabilities
No need for rxjava-reactive-streams dependency and
 CompletableFutureUtils anymore.
2015-10-19 11:15:03 +02:00
Sebastien Deleuze cb09e58a82 Fix SimpleHandlerResultHandler by using Publishers.completable() 2015-10-19 11:01:24 +02:00
Sebastien Deleuze 3ad765556d Polish ByteBufferPublisherInputStream exception handling 2015-10-16 15:35:16 +02:00
Sebastien Deleuze 8ca04b8425 More accurate ResponseBodyResultHandler error message 2015-10-16 09:13:44 +02:00
Stephane Maldini 06a1ddbe93 Eliminate need for reactor stream in CompletableFutureUtils + fixes 2015-10-16 09:11:22 +02:00
Stephane Maldini 80f9a21b9d Tweaks to ByteBufPubInputStream to use available blockingQueue facilities 2015-10-16 09:10:07 +02:00
Stephane Maldini b11bef7a26 Eliminate need for rxJava in Json Encoder 2015-10-16 09:07:51 +02:00
Stephane Maldini 985640b6ce Fix ReactorHttpServer with latest changes on shutdown behavior 2015-10-12 11:22:28 +02:00
Sebastien Deleuze 0042a65c53 Await properly Reactor server start/stop
The goal is to try to fix #32
With this change de Reactor test seems to execute slowly.
2015-10-09 11:38:35 +02:00
Sebastien Deleuze 07374f48d6 Move server related classes from src/test to src/main 2015-10-07 14:06:26 +02:00
Stephane Maldini 464ff1d960 Progress #24
Replace Streams fail, empty and Stream map with Publishers.error, empty and map.
Replace Streams calls by Publishers.flatMap, just and Publishers.from
Precise cancel and size to toReadQueue to simulate Promise
Update build
2015-10-07 12:24:32 +01:00
Sebastien Deleuze 0dabdb8207 Add request method based mapping
Closes #22
2015-10-07 12:15:39 +02:00
Sebastien Deleuze 906dead596 Polishing 2015-10-07 12:13:35 +02:00
Stephane Maldini ec1189b0b5 minor fix and update to work on latest 2.1.0.BUILD-SNAPSHOT to use core check in CFUtils 2015-10-05 16:49:25 +01:00
Sebastien Deleuze 32214e0a49 Add Javadoc for main interfaces/classes 2015-10-05 14:18:15 +02:00
Sebastien Deleuze 9516c9992f Return HandlerResult in HandlerAdapter#handle()
This commit updates HandlerAdapter#handle() to return HandlerResult
instead of Publisher<HandlerResult>. A new SimpleHandlerResultHandler
class has been introduced for handlers returning Publisher<Void>.
2015-10-02 20:09:27 +02:00
Sebastien Deleuze 49fc32e214 Check new snapshots for every build 2015-10-01 17:07:13 +02:00
Stephane Maldini d20fbffcd0 Update to Reactor 2.1.0.BUILD-SNAPSHOT 2015-09-29 23:31:02 +01:00
Stephane Maldini 4ffec61310 Update to 2.0.6 snapshot for Header sent too soon fix, which allows DispatcherHandler to assign content-type correctly. 2015-09-29 23:16:06 +01:00
Stephane Maldini 20c4011094 initialize reactor support, not passing requestmapping tests yet 2015-09-29 14:07:36 +01:00
Sebastien Deleuze f816cc6a51 Add CompletableFuture/Single/Promise support 2015-09-24 23:02:49 +02:00
Sebastien Deleuze 6716f969d6 Update README.md with artifact infos 2015-09-22 12:27:34 +02:00
Sebastien Deleuze ba66de0dc3 Set Gradle project name for CI 2015-09-22 12:14:02 +02:00
João Pedro Evangelista d3e5d9dd03 Polishing 2015-09-22 09:14:29 +02:00
Sebastien Deleuze 110d9d7cd9 Use ByteBuffer instead of byte[] 2015-09-22 08:02:57 +02:00
Sebastien Deleuze 9cbe984598 Create README.md 2015-09-21 09:48:30 +02:00
Sebastien Deleuze 77c5b3fd65 Fix RxNetty tests by finding a new port for each test 2015-09-17 14:25:57 -04:00
Stephane Maldini 6da7453517 Merge remote-tracking branch 'origin/master' 2015-09-11 17:06:50 -04:00
Sebastien Deleuze 4d29110cd7 Polish Gradle configuration for deployment 2015-09-11 22:46:44 +02:00
Stephane Maldini 5e39858780 ignore for now 2015-09-11 16:09:49 -04:00
Sebastien Deleuze 870c1ae43b Polishing 2015-09-10 18:39:17 +02:00
Sebastien Deleuze ca1ec24aa9 Define the group to use for the dependency 2015-09-10 18:06:38 +02:00
Sebastien Deleuze 3f6301648e Update version to 0.1.0.BUILD-SNAPSHOT 2015-09-10 17:48:29 +02:00
Sebastien Deleuze 3fd0f60618 Polish integration tests 2015-09-10 17:44:06 +02:00
Sebastien Deleuze 881db0688b Add Codec support
This commit adds support for Publisher based codecs that allows to convert
byte stream to object stream and vice & versa.

Jackson, JAXB2 and String codec implementations are provided.
2015-09-10 13:47:54 +02:00
Sebastien Deleuze 5ddbbf4673 Rename XMLHandler.java to XmlHandler.java 2015-09-10 13:31:42 +02:00
Arjen Poutsma 01ef90f1ca Fixed tests. 2015-09-10 11:36:14 +02:00
Arjen Poutsma 0b19fca73a Added cancellation logic to RequestBodyPublisher. 2015-09-10 11:18:51 +02:00
Arjen Poutsma 5bbeb9c204 Removed BlockingSignalQueue in favor of PublisherSignal. 2015-09-10 11:05:30 +02:00
Arjen Poutsma 0ec29d1c67 Fixed stalling issue in RequestBodyPublisher. 2015-09-04 13:33:02 +02:00
Sebastien Deleuze c1f179677a Polishing 2015-08-27 20:18:18 +02:00
Rossen Stoyanchev 202825554c Add basic support for @RequestMapping
Just enough for a test with an @ResponseBody method that accepts an
@RequestParam String arg and returning Publisher<String> or String.

See RequestMappingIntegrationTests.
2015-08-25 12:45:46 -04:00
Sebastien Deleuze 9df3dd4495 Polish build.gradle 2015-08-25 14:39:36 +02:00
Rossen Stoyanchev bc7a5acd50 Add simple URL mapping and handling
This commit adds support for simple URL handler mapping (exact path
match) and an adapter for the HttpHandler interface to be used to
handle the request.

The SimpleUrlHandlerMappingIntegrationTests then maps the URLs
"/foo" and "/bar" to two different handlers.
2015-08-24 17:33:01 -04:00
Rossen Stoyanchev d6fd274771 Add HttpServer and Jetty/Tomcat/RxNetty implementations
This is a refactoring of the existing "echo" integration test with the
goal to make it easier to add further integration tests.

The HttpServer abstraction is on the test source side for now.
2015-08-24 16:33:22 -04:00
Rossen Stoyanchev f020a1add1 Refactor package structure
Introduce http and dispatch packages under org.springframework.web to
separate HTTP-specific adapter code from higher level web framework
code. Move classes into their respective locations.
2015-08-24 14:41:58 -04:00
Rossen Stoyanchev 56d6940485 Replace Promises.error->Streams.fail, concatMap->map 2015-08-24 14:03:36 -04:00
Rossen Stoyanchev 6634d1f536 Use Streams from reactor-streams 2015-08-17 18:36:18 -04:00
Rossen Stoyanchev 69d4eaaa3c Use PublisherFactory from reactor-core 2015-08-17 16:52:39 -04:00
Rossen Stoyanchev 773d0444bf Add request handling infrastructure
HandlerMapping, HandlerAdapter, HandlerResultHandler (+ HandlerResult)
as the basic request handling contracts. DispatcherHandler to drive
overall request handling.

DispatcherApp provides minimal implementations of the above contracts
enough to put together a running example that returns
200 text/plain "Hello world".
2015-08-17 15:54:06 -04:00
Rossen Stoyanchev c682895dee Add RxNetty support
This commit adds RxNetty integration that includes RxNetty-based
implementations of ServerHttpRequest and ServerHttpResponse as well as
an adapter from the RxNetty RequestHandler to the HttpHandler contracts.

Only byte[] is supported at the moment for reading and writing with a
corresponding copy to and from Netty ByteBuf.
2015-08-11 16:17:34 -04:00
Rossen Stoyanchev 2cb32a0fd6 Add ServerHttpRequest & ServerHttpResponse
This commit introduces HTTP request and response abstractions along
with Servlet-based implementations similar to the ones in the http
package of spring-web but using Reactive Streams.

In turn HttpHandler now accepts the request and response types and
returns Publisher<Void> that reflects the end of handling.

The write method on the response also returns Publisher<Void> allowing
deferred writing. At the moment however the underlying Servlet 3.1
support only supports a single publisher after which the connection
is closed.

Only simple byte[] is supported for reading and writing.
2015-08-11 16:09:51 -04:00
Rossen Stoyanchev bb25267525 Fix whitespaces in build.gradle 2015-08-10 14:18:59 -04:00
Rossen Stoyanchev e770b7de41 Tests pass
For Tomcat, failures occur if HttpHandlerServlet buffer size is
significantly less than the Tomcat input buffer size.

Also on command line Jetty tests fail with port unavailable unless
the server from the Tomcat tests is also destroyed.
2015-08-08 03:57:29 -04:00
Rossen Stoyanchev 17b3db2988 Add gradle wrapper 2015-08-08 03:57:29 -04:00
Rossen Stoyanchev c464cddf83 Update versions 2015-08-08 03:57:23 -04:00
Arjen Poutsma 3595c51d40 Introduced DemandCounter 2015-07-29 14:21:10 +02:00
Arjen Poutsma 74a29ac146 Renamed 'rx' package to 'reactive' 2015-07-09 13:42:48 +02:00
Arjen Poutsma f518d76a77 Working version of Servlet 3.1 <-> RS bridge. 2015-07-07 12:53:45 +02:00
Arjen Poutsma 3b45087c87 work, work. 2015-07-01 15:03:14 +02:00
Arjen Poutsma c552aaa6f1 work, work. 2015-06-30 13:45:54 +02:00
Arjen Poutsma 342299abf6 Initial commit 2015-06-05 15:38:50 +02:00