Am 15.08.2014 08:15, schrieb Jon V.:
Yes, if the iohandle is blocking the execution then that would obviously do
it   That said I am not sure how the reactor threading in Mina would handle
very small messages sent in a way that prevents the data from aggregating.
Difference is 20k individual triggers or 1k triggers for the same number of
messages.

On Aug 15, 2014 2:00 AM, "Emmanuel Lécharny" <[email protected]> wrote:


One of the possible reasons : the server IoHandler is doing weird things
(like waiting for an external resource before releasing the thread).
Typical use case : sendinhg the received data to a remote data base.

So bottom line : what do you do on the server side with the data you
receive ?

Personally, I think it's a good idea to keep the code in IoHandler very small and simple, and forward the "work" to a dedicated thread-pool/executor-service.

In my code, all the IoHandler is doing, is to check which kind of message is received and decide what to do next. The actual work on the message is done in a thread pool. So my IoHandler is just a kind of message-dispatcher. Small, simple and efficient. This ensures - at least in my scenario - the highest possible message throughput on MINA side of the code.

br,
Alex

Reply via email to