Le 11/23/12 12:22 PM, Jens Reimann a écrit :
> Hello,
>
> Mina (seen with 2.0.4 and retested with 2.0.7) seems to have a problem
> when multiple, different ProtocolCodecFilters are added to a filter
> chain. While the CumulativeProtocolDecoder class uses "getClass()" for
> creating the AttributeKey of its buffer ( -- BUFFER = new
> AttributeKey(getClass(), "buffer") -- ) the ProtocolCodecFilter itself
> uses "ProtocolCodecFilter.class" ( -- new
> AttributeKey(ProtocolCodecFilter.class, "encoder") -- ).
>
> In my scenario this seems to cause some (not all) messages to walk the
> wrong chain of filters, actually skipping the second
> ProtocolCodecFilter in the chain.

Can you be a bit more explicit ? We are storing two differents
attributes (one is the 'buffer', the other one is the 'encoder'), and
the way we store them in the session is irrelevant.

I suspect there is something else that cause your decoders to work in a
way you don't expect.
>
> I am not sure what would the actual fix for that, but I would expect
> that it is possible to add multiple, different ProtocolCodecFilters to
> the same filter chain.

The problem is that once you have decoded a bytes buffer, you now have a
message. If the next decoder is expecting another bytes buffer, then it
won't be happy. Or your second flter will have to decode a message, not
an IoBuffer.

Otherwise, you may want to decode the received IoBuffer using different
decoder, but that means you should be able to detect which decoder to
call. You have to code that.

Unless I missed something...


-- 
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com 

Reply via email to