类 MessageParser


  • public class MessageParser
    extends java.lang.Object
    Helper class to work with a raw Pulsar entry payload.
    • 嵌套类概要

      嵌套类 
      修饰符和类型 说明
      static interface  MessageParser.MessageProcessor
      Definition of an interface to process a raw Pulsar entry payload.
    • 方法概要

      所有方法 静态方法 具体方法 
      修饰符和类型 方法 说明
      static void parseMessage​(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.ByteBuf uncompressPayloadIfNeeded​(TopicName topic, MessageMetadata msgMetadata, io.netty.buffer.ByteBuf payload, long ledgerId, long entryId, int maxMessageSize)  
      static boolean verifyChecksum​(TopicName topic, io.netty.buffer.ByteBuf headersAndPayload, long ledgerId, long entryId)  
      • 从类继承的方法 java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 构造器详细资料

      • MessageParser

        public MessageParser()
    • 方法详细资料

      • 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 provided MessageParser.MessageProcessor will be invoked for each individual message.
        抛出:
        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)