To use or not to use netty?

rzo rzo at gmx.de
Sat Jan 9 04:07:30 EST 2010


Hello,

this would be a very good application for the contribution I provided:

https://jira.jboss.org/jira/browse/NETTY-242

This contribution implements asynchronous hessian2 rpc on top of netty.

During my tests I was able to transmit 100000 calls in less than a 
second and receive all replies
in apprx 5 seconds. This comes to a total of apprx 17.000 calls/replies 
per second.

Given that the patch supports continuations (cometd) and sessions. It 
could scale to an unlimited
number of connections.

With continuations you do not need to maintain a thread per call. All 
calls are queued
and you may decide how many threads should handle the calls. You can 
also receive just one call and send
multiple replies. This is useful when you for example need an event 
based update of a gui table.

Sessions allow you to send a call and then disconnect and reconnect some 
time later. On reconnect all pending replies are
transmitted. The session maintains per client the complete netty 
pipeline. If the client does not reconnect within a timeout
the session is destroyed and the client will create a new session. With 
sessions, the clients do not have to maintain
the connection to the server. The server may limit the number of open 
connections and using a LRU map may close unused connections.
Clients may reconnect after a timeout and get the reply.

Integrating it into an existing application should be easy. On the 
server side you can wrap just any object.
The patch provides wrappers for immediate execution and for 
continuations. For continuations you will have to
implement how these are handled. With immediate execution you are set to go.

On the client side you have to create a new interface which is a copy of 
your service interface but for which all methods return an Object.
With a proxy factory you may create synchronous or asynchronous proxies. 
With asynchronous proxies you may use your existing service method 
invocations.

I am currently using this for a new feature within my project. However 
this has not been released, so it should be considered as alpha.

-- ron
http://yajsw.sourceforge.net


More information about the netty-users mailing list