mina-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Austin Lee" <austinflor...@gmail.com>
Subject Re: Question regarding turning many NIO sockets into 1 backend socket stream
Date Sat, 08 Jul 2006 21:45:25 GMT

Once again, that was a very concise and useful reply (=

> a thread from the ThreadPoolFilter, thus if you take a little bit of
> time to do things, you aren't blocking the NIO processing threads.

Good to know I have a few microseconds to do something in between.
Perhaps I can do something useful with that time on some of the

I've been doing alot of research and have looked extensively into
ActiveMQ among other products. ActiveMQ seems to support the NIO
functionality I need as well (to handle the thousands of concurrent
connections on the public side). It also has a built in queueing
feature (actually, that seems to be the project's main purpose). This
feature can do in-VM queueing -- which would be ideal for testing in
alpha stages -- and then can easily plug the queue, transparently,
across a socket, for "production mode" when the program is deployed
across servers. My program would be ignorant to the queue's transport
(VM or socket) which seems quite convenient.

I certainly need queueing for the application, so I'm likely to use
ActiveMQ to some capacity.

What do you think of ActiveMQ's NIO ability to handle multiple
connections? How does it stand up against MINA? Would a hybrid setup
with ActiveMQ to provide the queue/transport between servers and MINA
to provide the public-facing side be the best approach?

Thanks again,

On 7/8/06, peter royal <proyal@apache.org> wrote:
> On Jul 7, 2006, at 2:46 PM, Austin Lee wrote:
> > Does anyone know of a good way to go about taking all of an NIO's
> > server requests on the public-facing side and routing them through a
> > SINGLE socket to a backend server?
> ...
> > The NIO Server would receive each user's data until it is a full
> > "message" then pass each message to the dedicated backend server
> > asyncronously, through the socket (kind of like a queue).
> sure, use MINA :) use an IoFilter to assemble full messages, and in
> your IoHandler, use an IoConnector to connect to your backend system.
> > Does anyone know how best to go about doing this? Also, would this be
> > a good approach if I need to do alot of "number crunching" or
> > intensive database access for some requests and I don't want to slow
> > down the NIO's progress on all connections? Or if I need
> > heavy and slow database accesses on certain requests?
> sure, it'll work.. but my initial approach might be to just do the
> work in the IoHandler, and not worry about introducing another system.
> by default, by the time the events hit your IoHandler, its running on
> a thread from the ThreadPoolFilter, thus if you take a little bit of
> time to do things, you aren't blocking the NIO processing threads.
> The only drawback to that is if you wanted to be able to process
> multiple requests from your client in parallel. If you needed to do
> that, you'd have to do something like your initial idea (although it
> could be done in a single JVM just by using a queue vs a socket to
> send stuff out).
> -pete
> --
> proyal@apache.org - http://fotap.org/~osi

View raw message