Class RedisPubSubProvider
- java.lang.Object
-
- org.nuxeo.runtime.pubsub.AbstractPubSubProvider
-
- org.nuxeo.ecm.core.redis.contribs.RedisPubSubProvider
-
- All Implemented Interfaces:
PubSubProvider
public class RedisPubSubProvider extends AbstractPubSubProvider
Redis implementation ofPubSubProvider.- Since:
- 9.1
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classRedisPubSubProvider.DispatcherSubscribes to the provided Redis channel pattern and dispatches received messages.
-
Field Summary
Fields Modifier and Type Field Description protected RedisPubSubProvider.Dispatcherdispatcherprotected Threadthreadprotected static StringTHREAD_NAMEprotected static ExecutorServiceTHREAD_POOLstatic longTIMEOUT_SUBSCRIBE_SECONDSMaximum delay to wait for a channel subscription on startup.-
Fields inherited from class org.nuxeo.runtime.pubsub.AbstractPubSubProvider
namespace, subscribers
-
-
Constructor Summary
Constructors Constructor Description RedisPubSubProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()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.voidpublish(String topic, byte[] message)Publishes a message to the given topic.-
Methods inherited from class org.nuxeo.runtime.pubsub.AbstractPubSubProvider
localPublish
-
-
-
-
Field Detail
-
TIMEOUT_SUBSCRIBE_SECONDS
public static final long TIMEOUT_SUBSCRIBE_SECONDS
Maximum delay to wait for a channel subscription on startup.- See Also:
- Constant Field Values
-
THREAD_NAME
protected static final String THREAD_NAME
- See Also:
- Constant Field Values
-
THREAD_POOL
protected static final ExecutorService THREAD_POOL
-
dispatcher
protected RedisPubSubProvider.Dispatcher dispatcher
-
thread
protected Thread thread
-
-
Method Detail
-
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
-
close
public void close()
Description copied from interface:PubSubProviderFrees the resources.- Specified by:
closein interfacePubSubProvider- Overrides:
closein classAbstractPubSubProvider
-
publish
public void publish(String topic, byte[] message)
Description copied from interface:PubSubProviderPublishes a message to the given topic.- Parameters:
topic- the topicmessage- the message
-
-