public class Message extends 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 STAN cluster.
|
int |
getCrc32()
Returns the CRC32 checksum for the message.
|
byte[] |
getData()
Returns the message payload data.
|
String |
getReplyTo()
Returns the reply subject.
|
long |
getSequence()
Returns the message sequence number.
|
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(String reply)
Sets the message reply subject.
|
void |
setSubject(String subject)
Sets the message subject.
|
String |
toString() |
public long getSequence()
public String getSubject()
public void setSubject(String subject)
subject
- the message subjectIllegalStateException
- if the message is immutablepublic String getReplyTo()
public void setReplyTo(String reply)
reply
- the reply subjectIllegalStateException
- 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 STAN cluster believes this message has been redelivered,
otherwise false
public int getCrc32()
public void ack() throws IOException
IOException
- if an I/O exception occursCopyright © 2016-2017 Apcera, Inc.. All Rights Reserved.