Hi,
I've been using MINA for a couple of days to write a server that does roughly
the following:
o Receive data objects via a text/line-based protocol
o Pass them on the a processing engine (can be something that blocks)
One or more clients maintain a TCP/IP connection (one per client) over which a
stream of such objects will be received over time, potentially hundreds per
second. Clients will not open/close a connection when they intend to send an
object, instead they keep an open connection to the server at all time.
My idea was to use the following FilterChain:
o ProtocolCodecFilter / TextLineCodec
o DeserializationFilter (receives lines and once the complete object, composed
of multiple lines, has been received, creates the accompanying DataObject
and passes it on to the next filter, i.e. the handler)
o ExecutionFilter that uses a thread pool to achieve per-dataobject concurrency
on the ServerHandler
o ServerHandler: receives DataObjects and passes them to the processing engine.
This happens concurrently, the processing engine is
thread-safe.
I tried this out but it didn't work, only one thread per IoSession is spawned
by the
ExecutionFilter, not per "event". Is there any way I can achieve what I want
using
the MINA filter chain or do I have to use a thread pool in the ServerHandler?
Regards
Alex