I'm trying to make the below model 'a non blocking IO' model. Flow:
- servlet filters intercept and do some business (authentication,authorization,wrapping the request)
- depending upon the request method, apache http client(library)is used to make further service requests
- http client gives response and this is sent to the caller
AsyncContext from servlet 3 spec though solves the need, still it requires the worker thread to be created.
Is there any means to use netty(as a pluggable component inside servlet container) from the 2nd step to 3rd step? So that once the service response comes in the 3rd step, is taken care by the netty component to write to client without servlet container?
Or is there a way to have servlet filters written inside netty? Is apache HttpAsyncClient a good choice here?
Or any designs recommendations with the current approach?