Package org.nuxeo.runtime.pubsub
Class StreamPubSubProvider
java.lang.Object
org.nuxeo.runtime.pubsub.AbstractPubSubProvider
org.nuxeo.runtime.pubsub.StreamPubSubProvider
- All Implemented Interfaces:
PubSubProvider
A Pub/Sub provider based on Nuxeo Stream.
- Since:
- 10.1
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected LogAppender<Record> protected static final Stringprotected static final Stringprotected static final Stringstatic final Stringprotected static final Stringprotected static final Stringprotected Stringprotected Nameprotected Stringprotected static final Randomprotected ThreadFields inherited from class org.nuxeo.runtime.pubsub.AbstractPubSubProvider
namespace, subscribers -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Frees the resources.voidinitialize(Map<String, String> options, Map<String, List<BiConsumer<String, byte[]>>> subscribers) Initializes the resources for this provider and registers the local subscribers map.voidPublishes a message to the given topic.protected voidMethods inherited from class org.nuxeo.runtime.pubsub.AbstractPubSubProvider
localPublish
-
Field Details
-
GROUP_PREFIX
- See Also:
-
LOG_CONFIG_OPT
- See Also:
-
DEFAULT_LOG_CONFIG
- See Also:
-
LOG_NAME_OPT
- See Also:
-
CODEC_OPT
- See Also:
-
DEFAULT_CODEC
- See Also:
-
RANDOM
-
logConfig
-
logName
-
appender
-
thread
-
codec
-
nodeId
-
-
Constructor Details
-
StreamPubSubProvider
public StreamPubSubProvider()
-
-
Method Details
-
initialize
public void initialize(Map<String, String> options, Map<String, List<BiConsumer<String, byte[]>>> subscribers) Description copied from interface:PubSubProviderInitializes the resources for this provider and registers the local subscribers map.The options taken from the
PubSubProviderDescriptorThe subscribers map structure is thread-safe. The implementation must not modify the subscribers map in any way.- Specified by:
initializein interfacePubSubProvider- Overrides:
initializein classAbstractPubSubProvider
-
startConsumerThread
protected void startConsumerThread() -
publish
Description copied from interface:PubSubProviderPublishes a message to the given topic.- Parameters:
topic- the topicmessage- the message
-
close
public void close()Description copied from interface:PubSubProviderFrees the resources.- Specified by:
closein interfacePubSubProvider- Overrides:
closein classAbstractPubSubProvider
-