You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by Mindaugas JanuĊĦaitis <mi...@gmail.com> on 2007/04/13 22:36:56 UTC

Improved NIO support, Stomp enabled with NIO

Hello developers,

This is my first post :)

So here goes the story... I have written in C Partial implementation of
Stomp Broker
and there was a need to interconnect it with apache-mq the performance was
the bottleneck.

When I took a quick look @ stable src, there was no clue of using Java NIO,
but in SVN I found
a stub or initial implementation, a few minutes I was Happy as long as I
replaced 'StompTransportFactory extends TcpTransportFactory'
with StompTransportFactory extends NIOTransportFactory' and  was rewarded
with Exception :)

Further Investigation showed that This NIO implementation makes assumptions
about it's user, and it looks like it assumes that the OpenWire Protocol
uses it.
by the way, I found that there is no Transport that uses the
NIOTransportFactory at the moment.

My implementation should be 'Drop in replacement' for TcpTransportFactory. I
took universal approach and implemented: NIOBufferedInputStream &&
NIOBufferedOutputStream.   Despite the fact that we still have Thread per
client (with nio we should use selectors and less threads, but it would
require full apache-mq rewrite :) )  the performance improvement is about
80%. Basically it fullfils my requirements. It would be nice to have this
patch included.

Any Comments && Questions are welcome...

The patch is attached.