Package org.nuxeo.runtime.pubsub
Interface PubSubService
-
- All Known Implementing Classes:
PubSubServiceImpl
public interface PubSubServicePublish/Subscribe Service.This service allows cross-instance notifications through simple messages sent to topics.
- Since:
- 9.1
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidpublish(String topic, byte[] message)Publishes a message to the given topic.voidregisterSubscriber(String topic, BiConsumer<String,byte[]> subscriber)Registers a subscriber for the given topic.voidunregisterSubscriber(String topic, BiConsumer<String,byte[]> subscriber)Unregisters a subscriber for the given topic.
-
-
-
Method Detail
-
publish
void publish(String topic, byte[] message)
Publishes a message to the given topic.- Parameters:
topic- the topicmessage- the message
-
registerSubscriber
void registerSubscriber(String topic, BiConsumer<String,byte[]> subscriber)
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
void unregisterSubscriber(String topic, BiConsumer<String,byte[]> subscriber)
Unregisters a subscriber for the given topic.- Parameters:
topic- the topicsubscriber- the subscriber
-
-