Note that there are some explanatory texts on larger screens.

plurals
  1. POMigrating sendUpstream in Netty 4
    primarykey
    data
    text
    <p>I'm migrating from netty 3 to netty 4. I have a pipeline handler that acts as a classic filter, intercepting/handling noncompliant messages on the way, and shoveling compliant ones upstream. </p> <p>Based on the documentation (<a href="http://netty.io/wiki/new-and-noteworthy.html" rel="nofollow">http://netty.io/wiki/new-and-noteworthy.html</a>), I expected to use <code>ctx.fireInboundBufferUpdated()</code> in lieu of <code>ctx.sendUpStream()</code> to relay inbound. However, I've found this doesn't work, but <code>ChannelHandlerUtil.addToNextInboundBuffer()</code> does. I'd love some guidance as to: </p> <ol> <li>My confusion over the current docs assertion that <code>ctx.sendUpstream -&gt; ctx.fireInboundBufferUpdated</code> and, </li> <li>What is the best practice in this case, if different than what I've done below.</li> </ol> <p>The code:</p> <pre><code>//The pipeline public class ServerInitializer extends ChannelInitializer&lt;SocketChannel&gt; { @Override public void initChannel(SocketChannel ch) throws Exception { ChannelPipeline p = ch.pipeline(); p.addLast("decoder", new HttpRequestDecoder()); p.addLast("encoder", new HttpResponseEncoder()); p.addLast("inbound", InboundHttpRequestFilter.INSTANCE); p.addLast("handler", handlerClass.newInstance()); } } //The filter public class InboundHttpRequestFilter extends ChannelInboundMessageHandlerAdapter&lt;Object&gt; { @Override public void messageReceived(ChannelHandlerContext ctx, Object msg) throws Exception { ... discard/handle as necessary …; //ctx.fireInboundBufferUpdated(); - doesn't propagate upstream ChannelHandlerUtil.addToNextInboundBuffer(ctx, msg); // sends upstream } } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload