public class MutableMessage<T> extends Object implements Message<T>, Serializable
Message
with a generic payload. Unlike
GenericMessage
, this message (or its headers) can be modified
after creation. Great care must be taken, when mutating messages, that
some other element/thread is not concurrently using the message. Also note
that any in-memory stores (such as SimpleMessageStore
) may have
a reference to the message and changes will be reflected there too.Constructor and Description |
---|
MutableMessage(T payload) |
MutableMessage(T payload,
Map<String,Object> headers) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
MutableMessageHeaders |
getHeaders() |
T |
getPayload() |
int |
hashCode() |
String |
toString() |
public MutableMessage(T payload)
public MutableMessageHeaders getHeaders()
getHeaders
in interface Message<T>
public T getPayload()
getPayload
in interface Message<T>