Class InboundMessageHandler

  • All Implemented Interfaces:
    io.netty.channel.ChannelHandler, io.netty.channel.ChannelInboundHandler, FrameDecoder.FrameProcessor

    public class InboundMessageHandler
    extends AbstractMessageHandler
    Implementation of AbstractMessageHandler for processing internode messages from peers. # Small vs large messages Small messages are deserialized in place, and then handed off to an appropriate thread pool for processing. Large messages accumulate frames until completion of a message, then hand off the untouched frames to the correct thread pool for the verb to be deserialized there and immediately processed. # Flow control (backpressure) To prevent nodes from overwhelming and bringing each other to the knees with more inbound messages that can be processed in a timely manner, InboundMessageHandler implements a strict flow control policy. The size of the incoming message is dependent on the messaging version of the specific peer connection. See Message.Serializer.inferMessageSize(ByteBuffer, int, int, int). By default, every connection has 4MiB of exlusive permits available before needing to access the per-endpoint and global reserves. Permits are released after the verb handler has been invoked on the Stage for the Verb of the message.