Class FrameDecoderUtil

java.lang.Object
org.apache.pulsar.common.protocol.FrameDecoderUtil

public class FrameDecoderUtil extends Object
Utility class for managing Netty LenghtFieldBasedFrameDecoder instances in a Netty ChannelPipeline for the Pulsar binary protocol.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    addFrameDecoder(io.netty.channel.ChannelPipeline pipeline, int maxMessageSize)
    Adds a LengthFieldBasedFrameDecoder to the given ChannelPipeline.
    static void
    removeFrameDecoder(io.netty.channel.ChannelPipeline pipeline)
    Removes the LengthFieldBasedFrameDecoder from the given ChannelPipeline.
    static void
    replaceFrameDecoder(io.netty.channel.ChannelPipeline pipeline, int maxMessageSize)
    Replaces the existing LengthFieldBasedFrameDecoder in the given ChannelPipeline with a new one.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • FrameDecoderUtil

      public FrameDecoderUtil()
  • Method Details

    • addFrameDecoder

      public static void addFrameDecoder(io.netty.channel.ChannelPipeline pipeline, int maxMessageSize)
      Adds a LengthFieldBasedFrameDecoder to the given ChannelPipeline.
      Parameters:
      pipeline - the ChannelPipeline to which the decoder will be added
      maxMessageSize - the maximum size of messages that can be decoded
    • replaceFrameDecoder

      public static void replaceFrameDecoder(io.netty.channel.ChannelPipeline pipeline, int maxMessageSize)
      Replaces the existing LengthFieldBasedFrameDecoder in the given ChannelPipeline with a new one.
      Parameters:
      pipeline - the ChannelPipeline in which the decoder will be replaced
      maxMessageSize - the maximum size of messages that can be decoded
    • removeFrameDecoder

      public static void removeFrameDecoder(io.netty.channel.ChannelPipeline pipeline)
      Removes the LengthFieldBasedFrameDecoder from the given ChannelPipeline. This is useful in the Pulsar Proxy to remove the decoder before direct proxying of messages without decoding.
      Parameters:
      pipeline - the ChannelPipeline from which the decoder will be removed