public interface RReliableTopicAsync extends RExpirableAsync
Dedicated Redis connection is allocated per instance (subscriber) of this object. Messages are delivered to all listeners attached to the same Redis setup.
Requires Redis 5.0.0 and higher.
Modifier and Type | Method and Description |
---|---|
<M> RFuture<String> |
addListenerAsync(Class<M> type,
MessageListener<M> listener)
Subscribes to this topic.
|
RFuture<Integer> |
countSubscribersAsync()
Returns amount of subscribers to this topic across all Redisson instances.
|
RFuture<Long> |
publishAsync(Object message)
Publish the message to all subscribers of this topic asynchronously.
|
RFuture<Void> |
removeAllListenersAsync()
Removes all listeners from this topic
|
RFuture<Void> |
removeListenerAsync(String... listenerIds)
Removes the listener by
id for listening this topic |
RFuture<Long> |
sizeAsync()
Amount of messages stored in Redis Stream object.
|
clearExpireAsync, expireAsync, expireAsync, expireAtAsync, expireAtAsync, remainTimeToLiveAsync
addListenerAsync, copyAsync, deleteAsync, dumpAsync, getIdleTimeAsync, isExistsAsync, migrateAsync, moveAsync, removeListenerAsync, renameAsync, renamenxAsync, restoreAndReplaceAsync, restoreAndReplaceAsync, restoreAsync, restoreAsync, sizeInMemoryAsync, touchAsync, unlinkAsync
RFuture<Long> sizeAsync()
RFuture<Long> publishAsync(Object message)
message
- to send<M> RFuture<String> addListenerAsync(Class<M> type, MessageListener<M> listener)
MessageListener.onMessage
method is called when any message
is published on this topic.
Watchdog is started when listener was registered.
M
- - type of messagetype
- - type of messagelistener
- for messagesConfig.setReliableTopicWatchdogTimeout(long)
,
MessageListener
RFuture<Void> removeListenerAsync(String... listenerIds)
id
for listening this topiclistenerIds
- - listener idsRFuture<Void> removeAllListenersAsync()
Copyright © 2014–2021 Redisson. All rights reserved.