[jboss-dev-forums] [Design of Messaging on JBoss (Messaging/JBoss)] - Re: servlet transport implementation

trustin do-not-reply at jboss.com
Wed Jan 14 02:18:48 EST 2009


Sorry for the late response.  I was busy with releasing Netty 3.1.0.ALPHA3. :-)

"ataylor" wrote : A ServletContextListener will create a ClientBootstrap on startup. This will be configured via properties, probably read in from a config file with some sensible defaults. This will be added as an attribute to the ServletTransport. It would be cool if netty had an invm client bootstrap to use however in the absence of this it will be a normal socket connection. Trustin, currently would there be any way of doing this invm?
What does 'invm' transport refer to here?  Do you want Netty to add in-vm transport, or do you want Netty can talk to the in-vm transport that JBM uses internally?  The only interfaces that you need to implement is 'ChannelFactory' and 'Channel', so it's not a big deal to implement a bridge between JBM invm transport and Netty.  ClientBootstrap should work with any ChannelFactory implementation.

"ataylor" wrote : An HttpSessionListener will be used to create a connection for each session. Since netty doesn't support cookies at the minute we will have to manually check the headers to pull out the session id and add it as a parameter for all further requests.
I think Netty needs to provide a cookie encoder / decoder as we did for query strings.

"ataylor" wrote : Also at this point we'll set the pipeline factory before creating the connection. a seperate instance of a 'ServletChannelHandler will be set for each connection. Both the Channel and the ServletChannelhandler will be added to the session as attributes.
  | 
  | The ServletChannelHandler will work 2 ways. On MessageReceived it will either 1) store the received buffers to be returned by the next http request (polling) or 2) write directly to the ServletOutputStream (streaming). 
  | 
  | The Servlet itself will decode the http request body and forward it via the channel previously set on the session. It will then set the appropriate headers on the response and return as the body any awaiting responses if using the polling method. 
I understood how it works, but out of curiosity, why does the Servlet need to talk to JBM via Netty?  Isn't it just enough for the Servlet to talk to JBM directly?  Perhaps I am missing out something.

"ataylor" wrote : From a client side we'll be able to reuse most of what we already have. maybe just a few changes for using sessions and for streaming.
  | 
  | Trustin, how would you like me to package the servlet classes etc. Also i'll include some sample web.xml configurations etc so where should i put these?
It could be distributed as a separate WAR, hence we could create a subproject under svn.jboss.org/repos/netty/subproject/servlet (or some cool name :-)

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4201594#4201594

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4201594



More information about the jboss-dev-forums mailing list