Hi Alex,

On 11/6/07, Alex Suzuki <[EMAIL PROTECTED]> wrote:
> 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?

ExecutorFilter maintains the order of event so that your handler
implementation is not called simultaneously for the same session.  If
you want to disable this feature, you need to write your own filter,
or wait for 2.0.0-M1 release, which provides UnorderedExecutorFilter.

HTH,
Trustin
-- 
what we call human nature is actually human habit
--
http://gleamynode.net/
--
PGP Key ID: 0x0255ECA6

Reply via email to