Commit Graph

42 Commits

Author SHA1 Message Date
Arjen Poutsma
45a88974bc Changed addBody() to setBody() 2015-10-29 16:28:22 +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
07374f48d6 Move server related classes from src/test to src/main 2015-10-07 14:06:26 +02:00
Sebastien Deleuze
0dabdb8207 Add request method based mapping
Closes #22
2015-10-07 12:15:39 +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
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
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
77c5b3fd65 Fix RxNetty tests by finding a new port for each test 2015-09-17 14:25:57 -04: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
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
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
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
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
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