Do you have an executor filter in your chain ? *- No, both the filters extend ProtocolEncoderAdapter*
Otherwise, it seems you have enqueued a mssage which is not an IoBuffer, and this can't be sent. Like if encoder A directly pushes the message instead of going through the second encoder. *- The encoder A always writes to the ProtocolEncoderOutput out (given as argument in the encode method<http://www.ostools.net/uploads/apidocs/mina/org/apache/mina/filter/codec/ProtocolEncoder.html#encode(org.apache.mina.core.session.IoSession, java.lang.Object, org.apache.mina.filter.codec.ProtocolEncoderOutput)>)* It's difficult to tell what's going wrong without more information. Can you tell us more ? *- The use case is that the IoHandler upon receipt of a message, broadcasts a message of type 'K' to a set of clients. It does so by looping through all the IoSessions belonging to that set of clients and calling write on them with this object of type 'K'. Encoder A accepts messages of type 'K' as input. Encoder A then encodes the message into type 'X' and writes it to the given ProtocolEncoderOutput for encoder B to consume (As described earlier). Anything specific you would like me to tell you? Or what else I could log that could help.* * * -Dhruv On Wed, Nov 28, 2012 at 9:00 PM, Emmanuel Lécharny <[email protected]>wrote: > Le 11/28/12 4:21 PM, Dhruv Chopra a écrit : > > Hi, > Hi, > > > > My MINA server has a 2 filter chain (A and B - where output of encoder A > is > > further encoded by B and then sent out on the wire). Now everything works > > fine under normal load (20 clients with incoming 20 msgs/sec and outgoing > > 100 msg/sec). But when I increase the load - I randomly start getting > > exceptions with cause *"don't know how **to handle message of type 'X'**. > > Are you missing a protocol encoder?"*. This message of type 'X' is the > > output of my filter A's encoder and input for filter B's encoder. I added > > a bunch of logs and see that in the failure case, my filter B never > > received the output of filter A and this exception followed. I also > logged > > the threadids and see that when this occurred, thread 't' had encoded the > > message through filter A and then started encoding another message > through > > filter A. Then the exception occurs and same Thread 't' continues > encoding > > the other message through filter B. So its like it completely forgot to > > encode the earlier message through filter B. In the good cases, thread > 't' > > would after encoding an object through encoder A always encode that > through > > encoder B before doing anything else. > > > > Another thing is that when I only have one filter - even under higher > > stress, things work fine. > > Do you have an executor filter in your chain ? > > Otherwise, it seems you have enqueued a mssage which is not an IoBuffer, > and this can't be sent. Like if encoder A directly pushes the message > instead of going through the second encoder. > > It's difficult to tell what's going wrong without more information. Can > you tell us more ? > > -- > Regards, > Cordialement, > Emmanuel Lécharny > www.iktek.com > >
