Package org.apache.pulsar.client.impl
Class MessageImpl<T>
java.lang.Object
org.apache.pulsar.client.impl.MessageImpl<T>
- All Implemented Interfaces:
Message<T>
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionMessageImpl(String topic, String msgId, Map<String, String> properties, byte[] payload, Schema<T> schema, MessageMetadata msgMetadata) MessageImpl(String topic, String msgId, Map<String, String> properties, io.netty.buffer.ByteBuf payload, Schema<T> schema, MessageMetadata msgMetadata) -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> MessageImpl<T>create(String topic, BatchMessageIdImpl batchMessageIdImpl, MessageMetadata batchMetadata, SingleMessageMetadata singleMessageMetadata, io.netty.buffer.ByteBuf payload, Optional<EncryptionContext> encryptionCtx, ClientCnx cnx, Schema<T> schema, int redeliveryCount, boolean pooledMessage, long consumerEpoch) static <T> MessageImpl<T>create(String topic, MessageIdImpl messageId, MessageMetadata msgMetadata, io.netty.buffer.ByteBuf payload, Optional<EncryptionContext> encryptionCtx, ClientCnx cnx, Schema<T> schema, int redeliveryCount, boolean pooledMessage, long consumerEpoch) static <T> MessageImpl<T>create(MessageMetadata msgMetadata, ByteBuffer payload, Schema<T> schema, String topic) static MessageImpl<byte[]>deserialize(io.netty.buffer.ByteBuf headersAndPayload) static MessageImpl<byte[]>deserializeSkipBrokerEntryMetaData(io.netty.buffer.ByteBuf headersAndPayloadWithBrokerEntryMetadata) getCnx()byte[]getData()io.netty.buffer.ByteBuflonglonggetIndex()getKey()byte[]byte[]getProperty(String name) longintbyte[]longgetValue()booleanbooleanbooleanhasIndex()booleanhasKey()booleanbooleanhasProperty(String name) booleanbooleanstatic booleanisEntryExpired(int messageTTLInSeconds, long entryTimestamp) static booleanisEntryPublishedEarlierThan(long entryTimestamp, long timestamp) booleanisExpired(int messageTTLInSeconds) booleanvoidrecycle()voidrelease()voidsetBrokerEntryMetadata(BrokerEntryMetadata brokerEntryMetadata) voidsetMessageId(MessageId messageId) voidsetReplicatedFrom(String cluster) voidsetSchemaInfoForReplicator(SchemaInfo schemaInfo) intsize()
-
Field Details
-
messageId
-
-
Constructor Details
-
MessageImpl
-
MessageImpl
-
-
Method Details
-
create
public static <T> MessageImpl<T> create(MessageMetadata msgMetadata, ByteBuffer payload, Schema<T> schema, String topic) -
create
public static <T> MessageImpl<T> create(String topic, MessageIdImpl messageId, MessageMetadata msgMetadata, io.netty.buffer.ByteBuf payload, Optional<EncryptionContext> encryptionCtx, ClientCnx cnx, Schema<T> schema, int redeliveryCount, boolean pooledMessage, long consumerEpoch) -
create
public static <T> MessageImpl<T> create(String topic, BatchMessageIdImpl batchMessageIdImpl, MessageMetadata batchMetadata, SingleMessageMetadata singleMessageMetadata, io.netty.buffer.ByteBuf payload, Optional<EncryptionContext> encryptionCtx, ClientCnx cnx, Schema<T> schema, int redeliveryCount, boolean pooledMessage, long consumerEpoch) -
deserialize
public static MessageImpl<byte[]> deserialize(io.netty.buffer.ByteBuf headersAndPayload) throws IOException - Throws:
IOException
-
isEntryExpired
public static boolean isEntryExpired(int messageTTLInSeconds, long entryTimestamp) -
isEntryPublishedEarlierThan
public static boolean isEntryPublishedEarlierThan(long entryTimestamp, long timestamp) -
deserializeSkipBrokerEntryMetaData
public static MessageImpl<byte[]> deserializeSkipBrokerEntryMetaData(io.netty.buffer.ByteBuf headersAndPayloadWithBrokerEntryMetadata) throws IOException - Throws:
IOException
-
setReplicatedFrom
-
isReplicated
public boolean isReplicated()- Specified by:
isReplicatedin interfaceMessage<T>
-
getReplicatedFrom
- Specified by:
getReplicatedFromin interfaceMessage<T>
-
getPublishTime
public long getPublishTime()- Specified by:
getPublishTimein interfaceMessage<T>
-
getEventTime
public long getEventTime()- Specified by:
getEventTimein interfaceMessage<T>
-
getDeliverAtTime
public long getDeliverAtTime() -
isExpired
public boolean isExpired(int messageTTLInSeconds) -
getData
public byte[] getData() -
size
public int size() -
getSchemaInternal
-
getReaderSchema
- Specified by:
getReaderSchemain interfaceMessage<T>
-
getSchemaVersion
public byte[] getSchemaVersion()- Specified by:
getSchemaVersionin interfaceMessage<T>
-
getSchemaInfo
-
getSchemaHash
-
setSchemaInfoForReplicator
-
getSchemaInfoForReplicator
-
getValue
-
getSequenceId
public long getSequenceId()- Specified by:
getSequenceIdin interfaceMessage<T>
-
getProducerName
- Specified by:
getProducerNamein interfaceMessage<T>
-
getDataBuffer
public io.netty.buffer.ByteBuf getDataBuffer() -
getMessageId
- Specified by:
getMessageIdin interfaceMessage<T>
-
getProperties
- Specified by:
getPropertiesin interfaceMessage<T>
-
hasProperty
- Specified by:
hasPropertyin interfaceMessage<T>
-
getProperty
- Specified by:
getPropertyin interfaceMessage<T>
-
getMessageBuilder
-
hasKey
public boolean hasKey() -
getTopicName
- Specified by:
getTopicNamein interfaceMessage<T>
-
getKey
-
hasBase64EncodedKey
public boolean hasBase64EncodedKey()- Specified by:
hasBase64EncodedKeyin interfaceMessage<T>
-
getKeyBytes
public byte[] getKeyBytes()- Specified by:
getKeyBytesin interfaceMessage<T>
-
hasOrderingKey
public boolean hasOrderingKey()- Specified by:
hasOrderingKeyin interfaceMessage<T>
-
getOrderingKey
public byte[] getOrderingKey()- Specified by:
getOrderingKeyin interfaceMessage<T>
-
getBrokerEntryMetadata
-
setBrokerEntryMetadata
-
getCnx
-
recycle
public void recycle() -
release
public void release() -
hasBrokerPublishTime
public boolean hasBrokerPublishTime()- Specified by:
hasBrokerPublishTimein interfaceMessage<T>
-
getBrokerPublishTime
- Specified by:
getBrokerPublishTimein interfaceMessage<T>
-
hasIndex
public boolean hasIndex() -
getIndex
-
hasReplicateTo
public boolean hasReplicateTo() -
getReplicateTo
-
hasReplicateFrom
public boolean hasReplicateFrom() -
setMessageId
-
getEncryptionCtx
- Specified by:
getEncryptionCtxin interfaceMessage<T>
-
getRedeliveryCount
public int getRedeliveryCount()- Specified by:
getRedeliveryCountin interfaceMessage<T>
-