On Tue, 2019-05-14 at 07:51 -0700, Rafael Ferreira wrote:
> Howdy folks and apologies in advance if the information I’m looking
> for is available somewhere and I simply missed it. 
> 
> I’m trying to expand the example file server available here (
> https://github.com/apache/httpcomponents-core/blob/master/httpcore5-h2/src/test/java/org/apache/hc/core5/http2/examples/Http2FileServerExample.java
>  <
> https://github.com/apache/httpcomponents-core/blob/master/httpcore5-h2/src/test/java/org/apache/hc/core5/http2/examples/Http2FileServerExample.java
> >) into something that can consume a request with a body (a POST
> request for example) and I’m struggling to make sense of the
> interface abstractions, ideally, I would like to adapt the low level
> async interfaces to the classic HttpRequest/HttpResponse ones. 
> 
> Can anyone point me in either the direction of a more complex example
> http2 server using hc5 or just more examples of
> AsyncServerRequestHandler implementations? 
> 
> Big thanks! 
> 
> - Rafael 

Hi Rafael

What you might want to do is to start with 
AbstractServerExchangeHandler and add custom request processing and
response generation logic

https://github.com/apache/httpcomponents-core/blob/master/httpcore5/src/main/java/org/apache/hc/core5/http/nio/support/AbstractServerExchangeHandler.java

There is a project containing non-blocking (reactive) JSON message
processors with plenty of examples of fairly complex request consumers
and response producers.

https://github.com/ok2c/httpcomponents-jackson/tree/master/hc5-async-json/src/main/java/com/ok2c/hc5/json/http

Does this help in any way? If not, let me know what kind of request
messages your server is supposed to receive, what kind of response
messages it is supposed to send back and I can try and put together a
sample server specifically for such message exchanges.

Oleg


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to