Package org.apache.pulsar.common.api.raw
Class MessageParser
- java.lang.Object
-
- org.apache.pulsar.common.api.raw.MessageParser
-
public class MessageParser extends java.lang.ObjectHelper class to work with a raw Pulsar entry payload.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceMessageParser.MessageProcessorDefinition of an interface to process a raw Pulsar entry payload.
-
Constructor Summary
Constructors Constructor Description MessageParser()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidparseMessage(TopicName topicName, long ledgerId, long entryId, io.netty.buffer.ByteBuf headersAndPayload, MessageParser.MessageProcessor processor, int maxMessageSize)Parse a raw Pulsar entry payload and extract all the individual message that may be included in the batch.static io.netty.buffer.ByteBufuncompressPayloadIfNeeded(TopicName topic, MessageMetadata msgMetadata, io.netty.buffer.ByteBuf payload, long ledgerId, long entryId, int maxMessageSize)static booleanverifyChecksum(TopicName topic, io.netty.buffer.ByteBuf headersAndPayload, long ledgerId, long entryId)
-
-
-
Method Detail
-
parseMessage
public static void parseMessage(TopicName topicName, long ledgerId, long entryId, io.netty.buffer.ByteBuf headersAndPayload, MessageParser.MessageProcessor processor, int maxMessageSize) throws java.io.IOException
Parse a raw Pulsar entry payload and extract all the individual message that may be included in the batch. The providedMessageParser.MessageProcessorwill be invoked for each individual message.- Throws:
java.io.IOException
-
verifyChecksum
public static boolean verifyChecksum(TopicName topic, io.netty.buffer.ByteBuf headersAndPayload, long ledgerId, long entryId)
-
uncompressPayloadIfNeeded
public static io.netty.buffer.ByteBuf uncompressPayloadIfNeeded(TopicName topic, MessageMetadata msgMetadata, io.netty.buffer.ByteBuf payload, long ledgerId, long entryId, int maxMessageSize)
-
-