public class Message
extends java.lang.Object
Message object is used to send a message containing a stream of uninterpreted bytes.| Modifier and Type | Method and Description |
|---|---|
void |
ack()
Acknowledges the message to the streaming cluster.
|
int |
getCrc32()
Returns the CRC32 checksum for the message.
|
byte[] |
getData()
Returns the message payload data.
|
java.lang.String |
getReplyTo()
Returns the reply subject.
|
long |
getSequence()
Returns the message sequence number.
|
java.lang.String |
getSubject()
Returns the message subject.
|
long |
getTimestamp()
The message timestamp in nanoseconds.
|
boolean |
isRedelivered()
Determines whether or not this message has been redelivered to this client's connection.
|
void |
setData(byte[] data)
Sets the message payload data.
|
void |
setData(byte[] data,
int offset,
int length)
Sets the message payload data.
|
void |
setReplyTo(java.lang.String reply)
Sets the message reply subject.
|
void |
setSubject(java.lang.String subject)
Sets the message subject.
|
java.lang.String |
toString() |
public long getSequence()
public java.lang.String getSubject()
public void setSubject(java.lang.String subject)
subject - the message subjectjava.lang.IllegalStateException - if the message is immutablepublic java.lang.String getReplyTo()
public void setReplyTo(java.lang.String reply)
reply - the reply subjectjava.lang.IllegalStateException - if the message is immutablepublic byte[] getData()
public void setData(byte[] data)
data - the payload datapublic void setData(byte[] data,
int offset,
int length)
data - the payload dataoffset - the beginning offset to copy fromlength - the length to copypublic long getTimestamp()
public boolean isRedelivered()
true if the streaming cluster believes this message has been redelivered,
otherwise falsepublic int getCrc32()
public void ack()
throws java.io.IOException
java.io.IOException - if an I/O exception occurspublic java.lang.String toString()
toString in class java.lang.Object