public interface Message<T>
Modifier and Type | Method and Description |
---|---|
byte[] |
getData()
Get the content of the message
|
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.
|
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.
|
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.
|
Map<String,String> getProperties()
boolean hasProperty(String name)
name
- the name of the property to checkString getProperty(String name)
name
- the name of the propertybyte[] getData()
T getValue()
MessageId getMessageId()
long getPublishTime()
getEventTime()
long getEventTime()
MessageBuilder.setEventTime(long)
.
If there isn't any event time associated with this event, it will return 0.
MessageBuilder.setEventTime(long)
long getSequenceId()
MessageBuilder.setSequenceId(long)
.MessageBuilder.setEventTime(long)
String getProducerName()
boolean hasKey()
String getKey()
boolean hasBase64EncodedKey()
byte[] getKeyBytes()
String getTopicName()
Optional<EncryptionContext> getEncryptionCtx()
EncryptionContext
contains encryption and compression information in it using which application can
decrypt consumed message with encrypted-payload.Copyright © 2017–2018 Apache Software Foundation. All rights reserved.