public interface Request extends AutoCloseable
This interface is similar to Subscription. However, it has some important differences. Instances of
Subscription are Iterable; requests are not. A request cannot be iterable. If a reply to the request
is received before the Iterable.iterator() method is invoked, the reply will get lost. If the replies are
queued and Iterable.iterator() is never invoked, memory will be wasted.
Additionally, Subscription has a Subscription.addMessageHandler(MessageHandler) method for adding
MessageHandlers after the subscription has been created. Similar to the previous problem, if a reply is
received before the MessageHandler has been added to the request, receipt of the message will be lost.
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes this request.
|
Integer |
getMaxReplies()
Returns the maximum number of replies this request will receive.
|
int |
getReceivedReplies()
Returns the number of replies this request has received.
|
String |
getSubject()
Returns the subject the request was sent on.
|
void close()
MessageHandler objects associated with this request will no longer receive any
messages after this method is invoked.close in interface AutoCloseableString getSubject()
int getReceivedReplies()
Integer getMaxReplies()
null if no maximum was specified.Copyright © 2015. All Rights Reserved.