Le 25/10/16 à 16:54, Murty Devarakonda a écrit :
> We could identify what the problem is at last. While sending the response
> back to the client, we created a IoBuffer and added the bytes to the same
> and did a session.write(). And we identified that if the response is of
> type IoBuffer, Mina filter chain won't act on invoke the filters based on
> this line:
>
> ProtocolCodecFilter:filterWrite():
>
> // Bypass the encoding if the message is contained in a IoBuffer,
> // as it has already been encoded before
> if ((message instanceof IoBuffer) || (message instanceof
> FileRegion)) {
> nextFilter.filterWrite(session, writeRequest);
> return;
> }
>
> Somehow I missed that check and was scrambling why the filter is not getting
> used. May be it might be helpful for future developers if this is
> documented properly.
Glad to see that you have found the origin of your trouble :-)
Yes, we can add some documentation that says that using an IoBuffer or a
FileRehion will result in the encoder to not been call. That would be
teh smart thing to do...
Thanks for the feedback !