public class MessageEnvelop extends Object
Side note: a MessageEnvelope's message is stored as a buffer, so strings are converted using utf8 conversions.
| Constructor and Description |
|---|
MessageEnvelop()
Creates a new MessageEnvelope.
|
MessageEnvelop(String correlationId,
String messageType,
Object message)
Creates a new MessageEnvelop, which adds a correlation id, message id, and a
type to the data being sent/received.
|
MessageEnvelop(String correlationId,
String messageType,
String message)
Creates a new MessageEnvelop, which adds a correlation id, message id, and a
type to the data being sent/received.
|
| Modifier and Type | Method and Description |
|---|---|
String |
getCorrelationId() |
Object |
getMessage() |
<T> T |
getMessageAsJson(Class<T> type) |
String |
getMessageId() |
String |
getMessageType() |
Object |
getReference() |
ZonedDateTime |
getSentTime() |
void |
setCorrelationId(String value) |
void |
setMessage(Object value) |
void |
setMessageAsJson(Object message)
Stores the given string.
|
void |
setMessageId(String value) |
void |
setMessageType(String value) |
void |
setReference(Object value)
Sets a lock token reference for this MessageEnvelope.
|
void |
setSentTime(ZonedDateTime value) |
String |
toString()
Convert's this MessageEnvelope to a string, using the following format:
"[correlation_id, message_type, message.toString]". |
public MessageEnvelop()
public MessageEnvelop(String correlationId, String messageType, Object message)
correlationId - (optional) transaction id to trace execution through
call chain.messageType - a string value that defines the message's type.message - the data being sent/received.public MessageEnvelop(String correlationId, String messageType, String message)
correlationId - (optional) transaction id to trace execution through
call chain.messageType - a string value that defines the message's type.message - the data being sent/received.public Object getReference()
public void setReference(Object value)
value - the lock token to reference.public String getCorrelationId()
public void setCorrelationId(String value)
public String getMessageId()
public void setMessageId(String value)
public String getMessageType()
public void setMessageType(String value)
public ZonedDateTime getSentTime()
public void setSentTime(ZonedDateTime value)
public Object getMessage()
public void setMessage(Object value)
public void setMessageAsJson(Object message) throws com.fasterxml.jackson.core.JsonProcessingException
message - the string to set. Will be converted to a buffer, using UTF-8
encoding.com.fasterxml.jackson.core.JsonProcessingExceptionpublic <T> T getMessageAsJson(Class<T> type) throws com.fasterxml.jackson.databind.JsonMappingException, com.fasterxml.jackson.core.JsonParseException, IOException
com.fasterxml.jackson.databind.JsonMappingExceptioncom.fasterxml.jackson.core.JsonParseExceptionIOExceptionCopyright © 2018. All rights reserved.