Class FrameDecoderUtil
java.lang.Object
org.apache.pulsar.common.protocol.FrameDecoderUtil
Utility class for managing Netty LenghtFieldBasedFrameDecoder instances in a Netty ChannelPipeline
for the Pulsar binary protocol.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddFrameDecoder(io.netty.channel.ChannelPipeline pipeline, int maxMessageSize) Adds a LengthFieldBasedFrameDecoder to the given ChannelPipeline.static voidremoveFrameDecoder(io.netty.channel.ChannelPipeline pipeline) Removes the LengthFieldBasedFrameDecoder from the given ChannelPipeline.static voidreplaceFrameDecoder(io.netty.channel.ChannelPipeline pipeline, int maxMessageSize) Replaces the existing LengthFieldBasedFrameDecoder in the given ChannelPipeline with a new one.
-
Field Details
-
FRAME_DECODER_HANDLER
- See Also:
-
-
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 addedmaxMessageSize- 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 replacedmaxMessageSize- 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
-