public interface RReliableTopicRx extends RExpirableRx
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> io.reactivex.rxjava3.core.Single<String> |
addListener(Class<M> type,
MessageListener<M> listener)
Subscribes to this topic.
|
io.reactivex.rxjava3.core.Single<Integer> |
countSubscribers()
Returns amount of subscribers to this topic across all Redisson instances.
|
<M> io.reactivex.rxjava3.core.Flowable<M> |
getMessages(Class<M> type)
Returns continues stream of published messages.
|
io.reactivex.rxjava3.core.Single<Long> |
publish(Object message)
Publish the message to all subscribers of this topic asynchronously.
|
io.reactivex.rxjava3.core.Completable |
removeAllListeners()
Removes all listeners from this topic
|
io.reactivex.rxjava3.core.Completable |
removeListener(String... listenerIds)
Removes the listener by
id for listening this topic |
io.reactivex.rxjava3.core.Single<Long> |
size()
Amount of messages stored in Redis Stream object.
|
clearExpire, expire, expireAt, expireAt, expireAt, remainTimeToLive
addListener, copy, delete, dump, getCodec, getIdleTime, getName, isExists, migrate, move, removeListener, rename, renamenx, restore, restore, restoreAndReplace, restoreAndReplace, sizeInMemory, touch, unlink
io.reactivex.rxjava3.core.Single<Long> size()
io.reactivex.rxjava3.core.Single<Long> publish(Object message)
message
- to send<M> io.reactivex.rxjava3.core.Single<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)
,
MessageListener
io.reactivex.rxjava3.core.Completable removeListener(String... listenerIds)
id
for listening this topiclistenerIds
- - listener idsio.reactivex.rxjava3.core.Completable removeAllListeners()
io.reactivex.rxjava3.core.Single<Integer> countSubscribers()
<M> io.reactivex.rxjava3.core.Flowable<M> getMessages(Class<M> type)
M
- - type of messagetype
- - type of message to listenCopyright © 2014–2021 Redisson. All rights reserved.