public interface RReliableTopic extends RExpirable, RReliableTopicAsync
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> String |
addListener(Class<M> type,
MessageListener<M> listener)
Subscribes to this topic.
|
int |
countListeners()
Returns amount of registered listeners to this topic
|
int |
countSubscribers()
Returns amount of subscribers to this topic across all Redisson instances.
|
long |
publish(Object message)
Publish the message to all subscribers of this topic asynchronously.
|
void |
removeAllListeners()
Removes all listeners from this topic
|
void |
removeListener(String... listenerIds)
Removes the listener by
id for listening this topic |
long |
size()
Amount of messages stored in Redis Stream object.
|
clearExpire, expire, expire, expireAt, expireAt, remainTimeToLiveaddListener, copy, delete, dump, getCodec, getIdleTime, getName, isExists, migrate, move, removeListener, rename, renamenx, restore, restore, restoreAndReplace, restoreAndReplace, sizeInMemory, touch, unlinkaddListenerAsync, countSubscribersAsync, publishAsync, removeAllListenersAsync, removeListenerAsync, sizeAsyncclearExpireAsync, expireAsync, expireAsync, expireAtAsync, expireAtAsync, remainTimeToLiveAsyncaddListenerAsync, copyAsync, deleteAsync, dumpAsync, getIdleTimeAsync, isExistsAsync, migrateAsync, moveAsync, removeListenerAsync, renameAsync, renamenxAsync, restoreAndReplaceAsync, restoreAndReplaceAsync, restoreAsync, restoreAsync, sizeInMemoryAsync, touchAsync, unlinkAsynclong size()
long publish(Object message)
message - to send<M> String addListener(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),
MessageListenervoid removeListener(String... listenerIds)
id for listening this topiclistenerIds - - listener idsvoid removeAllListeners()
int countListeners()
int countSubscribers()
Copyright © 2014–2021 Redisson. All rights reserved.