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. -- View this message in context: http://apache-mina.10907.n7.nabble.com/ProtocolEncoder-not-getting-used-in-the-response-path-tp51558p51618.html Sent from the Apache MINA User Forum mailing list archive at Nabble.com.