public interface PubsubInterface
Modifier and Type | Interface and Description |
---|---|
static interface |
PubsubInterface.Callback
Callback passed to the subscribe method and called when a message
with subscribed topic arrives.
|
Modifier and Type | Method and Description |
---|---|
void |
publish(java.lang.String topic,
byte[] data,
java.lang.Object context)
Publishes given data as a specified topic.
|
int |
subscribe(java.lang.String topic,
PubsubInterface.Callback callback,
java.lang.Object context)
Subscribes a topic.
|
void |
unsubscribe(int subscriptionId)
Unsubscribes the subscription with the given ID.
|
void publish(java.lang.String topic, byte[] data, java.lang.Object context)
topic
- Topic definition.data
- Data to publish.context
- Context specific for a particular Pub/Sub implementation.int subscribe(java.lang.String topic, PubsubInterface.Callback callback, java.lang.Object context)
topic
- Topic definition to subscribe. Note that the definition format depends on the particular
Pub/Sub backend implementation and therefore e.g. wildcards can be used only if they are
supported by Pub/Sub backend.callback
- Callback to be called when a message with the specified topic arrives.context
- Context specific for a particular Pub/Sub implementation.void unsubscribe(int subscriptionId)
subscriptionId
- ID of the subscription to be unsubscribed.Last updated 2024-12-05 10:34:50