Constructor and Description |
---|
MessageImpl(String topic,
String msgId,
Map<String,String> properties,
io.netty.buffer.ByteBuf payload,
Schema<T> schema) |
Modifier and Type | Method and Description |
---|---|
static MessageImpl<byte[]> |
deserialize(io.netty.buffer.ByteBuf headersAndPayload) |
ClientCnx |
getCnx() |
byte[] |
getData()
Get the content of the message
|
io.netty.buffer.ByteBuf |
getDataBuffer() |
Optional<EncryptionContext> |
getEncryptionCtx()
EncryptionContext contains encryption and compression information in it using which application can
decrypt consumed message with encrypted-payload. |
long |
getEventTime()
Get the event time associated with this message.
|
String |
getKey()
Get the key of the message
|
byte[] |
getKeyBytes()
Get bytes in key.
|
PulsarApi.MessageMetadata.Builder |
getMessageBuilder() |
MessageId |
getMessageId()
Get the unique message ID associated with this message.
|
String |
getProducerName()
Get the producer name who produced this message.
|
Map<String,String> |
getProperties()
Return the properties attached to the message.
|
String |
getProperty(String name)
Get the value of a specific property
|
long |
getPublishTime()
Get the publish time of this message.
|
String |
getReplicatedFrom() |
List<String> |
getReplicateTo() |
long |
getSequenceId()
Get the sequence id associated with this message.
|
String |
getTopicName()
Get the topic the message was published to
|
T |
getValue() |
boolean |
hasBase64EncodedKey()
Check whether the key has been base64 encoded.
|
boolean |
hasKey()
Check whether the message has a key
|
boolean |
hasProperty(String name)
Check whether the message has a specific property attached.
|
boolean |
hasReplicateTo() |
boolean |
isExpired(int messageTTLInSeconds) |
boolean |
isReplicated() |
void |
recycle() |
void |
setReplicatedFrom(String cluster) |
protected MessageId messageId
public static MessageImpl<byte[]> deserialize(io.netty.buffer.ByteBuf headersAndPayload) throws IOException
IOException
public void setReplicatedFrom(String cluster)
public boolean isReplicated()
public String getReplicatedFrom()
public long getPublishTime()
Message
getPublishTime
in interface Message<T>
Message.getEventTime()
public long getEventTime()
Message
MessageBuilder.setEventTime(long)
.
If there isn't any event time associated with this event, it will return 0.
getEventTime
in interface Message<T>
MessageBuilder.setEventTime(long)
public boolean isExpired(int messageTTLInSeconds)
public byte[] getData()
Message
public long getSequenceId()
Message
MessageBuilder.setSequenceId(long)
.getSequenceId
in interface Message<T>
MessageBuilder.setEventTime(long)
public String getProducerName()
Message
getProducerName
in interface Message<T>
public io.netty.buffer.ByteBuf getDataBuffer()
public MessageId getMessageId()
Message
getMessageId
in interface Message<T>
public Map<String,String> getProperties()
Message
getProperties
in interface Message<T>
public boolean hasProperty(String name)
Message
hasProperty
in interface Message<T>
name
- the name of the property to checkpublic String getProperty(String name)
Message
getProperty
in interface Message<T>
name
- the name of the propertypublic PulsarApi.MessageMetadata.Builder getMessageBuilder()
public boolean hasKey()
Message
public String getTopicName()
Message
getTopicName
in interface Message<T>
public boolean hasBase64EncodedKey()
Message
hasBase64EncodedKey
in interface Message<T>
public byte[] getKeyBytes()
Message
getKeyBytes
in interface Message<T>
public ClientCnx getCnx()
public void recycle()
public boolean hasReplicateTo()
public Optional<EncryptionContext> getEncryptionCtx()
Message
EncryptionContext
contains encryption and compression information in it using which application can
decrypt consumed message with encrypted-payload.getEncryptionCtx
in interface Message<T>
Copyright © 2017–2018 Apache Software Foundation. All rights reserved.