Mina version ?

Alexander Christian wrote:
Hi together,

I have some questions about the ExecutorFilter:

To transfer messages, i primary use my own ProtocolCodecFactory which
converts my message objects into bytes and back.

I read on some presentations on the web, that it's a good idea to use
ExecutorFilter to speed up the system. So I used the following on the
server side

--code--
acceptor.getFilterChain().addFirst("executor", new
ExecutorFilter(filterchainWorkerPool));
--/code--

And also on the client side.

My system work's like this:

Client sends messages (their size can really differ, maybe <100 bytes,
maybe >100kbytes) to the server. The server has to interpret it, do some
action and reply a message with the same sequenceId back to the client.

The use of ExecutorFilters works well, if I have small messages, say about
50kbyte. But If such a message contains i.e. a HashTable with 100.000
entries, which is then serialized and transferred, the other side says:
--console--
NFO: exception Caught. session=(0x00CDEDFD: nio socket, server,
/150.158.180.128:3618 => /150.158.180.128:22222)
cause=org.apache.mina.filter.codec.ProtocolDecoderException:
org.apache.mina.core.buffer.BufferDataException:
java.io.StreamCorruptedException: invalid type code: 61 (Hexdump: 74 00 0A
... )
--/console--

As far as I understand, the client splits it's hughe message in several
pakets, because it's buffers are limited. But it seems that the executor
filter on the receiver side delegates the reading of pakets to different
Threads/Runnables (thanks to ExecutorFilter), which than causes a paket
re-order if the pakets are forwarded to the rest of the filter chain. This
leads to a corrupted stream so that the HashTable cannot be de-serialized
anymore. Without ExecutorFilter it's working fine.
So, is it a bad idea to use ExecutorFilter if also ProtocolCodecFactory is
used?! If so, ExecutorFilters are only "useful" if a message is not split
into several pakets and the paket-order doesn't not matter, right?
If not: Do you have any further suggestions on how to use the
ExecutorFilter in my scenario? Or did I have to kick out the
ExecutorFilter? What about performance?!


br,
Alex




--
--
cordialement, regards,
Emmanuel Lécharny
www.iktek.com
directory.apache.org


Reply via email to