| Constructor and Description |
|---|
DefaultMessage(String subject,
String body,
String queueGroup,
boolean request) |
| Modifier and Type | Method and Description |
|---|---|
String |
getBody()
Returns the body of the message.
|
String |
getQueueGroup()
Returns the queue group of the message.
|
String |
getSubject()
Returns the subject used to send the message.
|
boolean |
isRequest()
Returns
true if the message originated from a request, false if the message originated from a
publish. |
void |
reply(String body)
Sends a reply to this message.
|
void |
reply(String body,
long delay,
TimeUnit timeUnit)
Sends a reply to this message after the specified delay has passed.
|
String |
toString() |
public boolean isRequest()
Messagetrue if the message originated from a request, false if the message originated from a
publish. If the message originated from a request, the Message.reply(String) and
Message.reply(String, long, java.util.concurrent.TimeUnit) may be used to reply to the request.public String getSubject()
MessagegetSubject in interface Messagepublic String getQueueGroup()
MessagegetQueueGroup in interface Messagepublic String getBody()
Messagepublic void reply(String body) throws UnsupportedOperationException
MessagereplyTo field, a
NatsException will be thrown.reply in interface Messagebody - the message with which to reply to the requesterUnsupportedOperationException - if the message did not originate from a requestpublic void reply(String body, long delay, TimeUnit timeUnit) throws UnsupportedOperationException
MessagereplyTo field, a
NatsException will be thrown.reply in interface Messagebody - the message with which to reply to the requesterdelay - the amount of time to wait before sending the replytimeUnit - the time unit of the delay argumentUnsupportedOperationException - if the message did not originate from a requestCopyright © 2015. All Rights Reserved.