public interface Subscription extends AutoCloseable
Subscription
object to receive messages that have been published to a
subject.
Each Subscription
object is unique, even if the subscription is to the same subject.
This means that if StreamingConnection.subscribe("foo", cb)
is called twice in a row,
each of the
resulting Subscription
objects will be unique, and any message delivered on subject "foo"
will be delivered individually to both Subscription
objects.
Modifier and Type | Method and Description |
---|---|
void |
close()
Removes this subscriber from the server without removing durable interest (if it exists).
|
void |
close(boolean unsubscribe)
Removes this subscriber from the server.
|
SubscriptionOptions |
getOptions()
Returns the
SubscriptionOptions object for this Subscription object. |
String |
getQueue()
Returns the optional queue group name.
|
String |
getSubject()
Retrieves the subject of interest from the
Subscription object. |
void |
unsubscribe()
Removes interest in the
Subscription . |
String getSubject()
Subscription
object.String getQueue()
void unsubscribe() throws IOException
Subscription
.
For durables, it means that the durable interest is also removed from the server. Restarting a durable with the same name will not resume the subscription, it will be considered a new one.
This call is equivalent to close(true)
IOException
- if an error occurs while notifying the servervoid close() throws IOException
This call is equivalent to close(false)
close
in interface AutoCloseable
IOException
- if the close request times out or the client is connected to a server
for which this features is not available.AutoCloseable.close()
void close(boolean unsubscribe) throws IOException
unsubscribe
- if true
, durable interest is also removed.IOException
- if the close request times out or the client is connected to a server
for which this features is not available.SubscriptionOptions getOptions()
SubscriptionOptions
object for this Subscription
object.Subscription
's code SubscriptionOptions} object.SubscriptionOptions
Copyright © 2016-2017 Apcera, Inc.. All Rights Reserved.