Package org.nuxeo.runtime.pubsub
Interface PubSubService
- All Known Implementing Classes:
PubSubServiceImpl
public interface PubSubService
Publish/Subscribe Service.
This service allows cross-instance notifications through simple messages sent to topics.
- Since:
- 9.1
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Publishes a message to the given topic.void
registerSubscriber
(String topic, BiConsumer<String, byte[]> subscriber) Registers a subscriber for the given topic.void
unregisterSubscriber
(String topic, BiConsumer<String, byte[]> subscriber) Unregisters a subscriber for the given topic.
-
Method Details
-
publish
Publishes a message to the given topic.- Parameters:
topic
- the topicmessage
- the message
-
registerSubscriber
Registers a subscriber for the given topic.The subscriber must deal with the message without delay and return immediately, usually by storing it in a thread-safe datastructure.
- Parameters:
topic
- the topicsubscriber
- the subscriber, who will receive the topic and abyte[]
message
-
unregisterSubscriber
Unregisters a subscriber for the given topic.- Parameters:
topic
- the topicsubscriber
- the subscriber
-