If you can't debug the filter, that means some exception is probably thrown 
before entering into the filter. So you can debug the process from the handler 
to the filter to check the point where exception happens.



> On 24 Oct 2016, at 3:11 AM, Murty Devarakonda <murty.devarako...@matrixx.com> 
> wrote:
> 
> I wrote a custom Protocol Encoder implementing the ProtocolEncoder interface
> and I am using MINA 2.0.5 version.
> 
> But during testing, I am observing that the IoSession.write() call is not
> hitting the ProtocolEncoder at all.  What could be the reason for this?  I
> followed the creation of the ProtocolCodecFactory class correctly and my
> ProtocolDecoder is working correctly on the request path.  I am able to
> store some attributes in the IoSession and am able to make use of them in my
> request processing code.  
> 
> While sending back the response, I would like to see my breakpoint in the
> debug session reaching the ProtocolEncoder and make the appropriate changes
> to the response before writing out the response.  
> 
> Here is how my filter chain code is looking like:
> 
> protected static void addFilters(Properties props, NioSocketAcceptor
> acceptor, ProtocolCodecFactory factory)
>    {
>        DefaultIoFilterChainBuilder chain = acceptor.getFilterChain();
>        String threadCountStr = props.getProperty("threads");
>        int threadCount = threadCountStr == null ? s_threadCount :
> Integer.parseInt(threadCountStr.trim());
>        chain.addLast("protocol", new ProtocolCodecFilter(factory));
>        if (threadCount > 0) {
>            ExecutorFilter filter = new ExecutorFilter(0, threadCount,
> s_timeout, TimeUnit.SECONDS);
>            chain.addLast("limiter", filter);
>        }
>    }
> 
> Any help with this would be greatly appreciated.  I even tried logging the
> MINA related log lines at the debug level to see if there is an exception
> during response flow within MINA.  But there is no exceptions too.
> 
> 
> 
> --
> View this message in context: 
> http://apache-mina.10907.n7.nabble.com/ProtocolEncoder-not-getting-used-in-the-response-path-tp51558.html
> Sent from the Apache MINA User Forum mailing list archive at Nabble.com.

Reply via email to