Package com.atlassian.bitbucket.topic
Interface Topic<T extends Serializable>
public interface Topic<T extends Serializable>
- Since:
- 5.3
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Publishes a message to all (both local and on other cluster nodes) listeners of the topic.subscribe
(TopicListener<T> listener) Subscribes the provided listener to the topic.boolean
unsubscribe
(String subscriptionId) Unsubscribes a listener.
-
Method Details
-
getSettings
- Returns:
- the topic configuration
-
publish
Publishes a message to all (both local and on other cluster nodes) listeners of the topic.- Parameters:
message
- the message
-
subscribe
Subscribes the provided listener to the topic. The listener will receive callbacks for every message published to the topic after the listener was subscribed.- Parameters:
listener
- the listener that should receive callbacks when a message is published to the topic- Returns:
- the subscription ID, used to
unsubscribe
.
-
unsubscribe
Unsubscribes a listener. The listener will receive no more messages from the topic.- Parameters:
subscriptionId
- the subscription ID that was returned bysubscribe(TopicListener)
- Returns:
true
if the listener was successfully unsubscribed, otherwisefalse
-