[undertow-dev] Who Needs JAX-RS...

Stuart Douglas sdouglas at redhat.com
Mon Aug 31 21:20:41 EDT 2015


This is not really correct, as you are setting the exchange into blocking mode and reading from an input stream. 

If you want to go full async there are a few things you need to remove the 'startBlocking()' call. To read the request entity the easiest way before Undertow 1.3 (which is still not quite final) is to use io.undertow.util.StringReadChannelListener. If you are a recent 1.3.0 beta you can use the new HttpServerExchange.getRequestReceiver() API. 

Here is an example of a handler that uses StringReadChannelListener to simply attach the post data to the exchange:

https://github.com/undertow-io/undertow.js/blob/master/src/main/java/io/undertow/js/StringReadHandler.java

You can then get it in the next handler using the StringReadHandler.DATA attachment key.

Stuart

----- Original Message -----
> From: "Steve Logue" <bitvector2 at gmail.com>
> To: undertow-dev at lists.jboss.org
> Sent: Sunday, 30 August, 2015 12:00:49 PM
> Subject: [undertow-dev] Who Needs JAX-RS...
> 
> Hi Folks, I'm definitely new to Undertow and super impressed with it. However
> the docs are a bit thin in regards to using the RoutingHandler and doing
> full async processing. May I ask for a quick check of my approach to using
> Undertow and trying not to block anywhere:
> 
> https://github.com/bitvector2/microservice2/blob/master/src/main/java/org/bitvector/microservice2/HttpActor.java
> 
> -STEVEl
> 
> 
> --
> 
> http://www.bitvector.org/
> 
> _______________________________________________
> undertow-dev mailing list
> undertow-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/undertow-dev


More information about the undertow-dev mailing list