public interface Message
The byte[] returned by getData()
is not shared with any library code
and is safe to manipulate.
NOTICE: This interface is intended only to be implemented internally,
although since it is public it is technically available to anyone and
breaking changes should be avoided. For instance:
- Signatures should not be changed.
- If methods are added, a default implementation should be provided.
Modifier and Type | Method and Description |
---|---|
void |
ack()
ack acknowledges a JetStream messages received from a Consumer, indicating the message
should not be received again later.
|
void |
ackSync(java.time.Duration timeout)
ack acknowledges a JetStream messages received from a Consumer, indicating the message
should not be received again later.
|
default long |
consumeByteCount()
The number of bytes the server counts for the message when calculating byte counts.
|
Connection |
getConnection() |
byte[] |
getData() |
io.nats.client.impl.Headers |
getHeaders() |
java.lang.String |
getReplyTo() |
java.lang.String |
getSID() |
Status |
getStatus() |
java.lang.String |
getSubject() |
Subscription |
getSubscription() |
boolean |
hasHeaders() |
void |
inProgress()
Indicates that this message is being worked on and reset redelivery timer in the server.
|
boolean |
isJetStream()
Checks if a message is from JetStream or is a standard message.
|
boolean |
isStatusMessage() |
boolean |
isUtf8mode() |
io.nats.client.impl.AckType |
lastAck()
the last ack that was done with this message
|
io.nats.client.impl.NatsJetStreamMetaData |
metaData()
Gets the metadata associated with a JetStream message.
|
void |
nak()
nak acknowledges a JetStream message has been received but indicates that the message
is not completely processed and should be sent again later.
|
void |
nakWithDelay(java.time.Duration nakDelay)
nak acknowledges a JetStream message has been received but indicates that the message
is not completely processed and should be sent again later, after at least the delay amount.
|
void |
nakWithDelay(long nakDelayMillis)
nak acknowledges a JetStream message has been received but indicates that the message
is not completely processed and should be sent again later, after at least the delay amount.
|
void |
term()
term instructs the server to stop redelivery of this message without acknowledging it as
successfully processed.
|
java.lang.String getSubject()
java.lang.String getReplyTo()
boolean hasHeaders()
io.nats.client.impl.Headers getHeaders()
boolean isStatusMessage()
Status getStatus()
byte[] getData()
boolean isUtf8mode()
Subscription getSubscription()
java.lang.String getSID()
Connection getConnection()
io.nats.client.impl.NatsJetStreamMetaData metaData()
io.nats.client.impl.AckType lastAck()
void ack()
void ackSync(java.time.Duration timeout) throws java.util.concurrent.TimeoutException, java.lang.InterruptedException
timeout
- the duration to wait for an ack confirmationjava.util.concurrent.TimeoutException
- if a timeout was specified and the NATS server does not return a responsejava.lang.InterruptedException
- if the thread is interruptedvoid nak()
void nakWithDelay(java.time.Duration nakDelay)
nakDelay
- tell the server how long to delay before processing the ackvoid nakWithDelay(long nakDelayMillis)
nakDelayMillis
- tell the server how long to delay before processing the ackvoid term()
void inProgress()
boolean isJetStream()
default long consumeByteCount()