Package org.redisson.api
Interface RReliableFanoutReactive<V>
- Type Parameters:
V- The type of message payload
- All Superinterfaces:
RDestroyable,RExpirableReactive,RObjectReactive
Reliable fanout implementation that ensures message delivery to subscribed queues.
- Author:
- Nikita Koksharov
-
Method Summary
Modifier and TypeMethodDescriptionreactor.core.publisher.Mono<Integer> Returns amount of subscribers to this fanout.Returns a list of the names of all subscribers to this fanout.reactor.core.publisher.Mono<Boolean> isSubscribed(String name) Checks if a queue with the specified name is subscribed to this fanout.publish(FanoutPublishArgs<V> args) Publishes a message to all subscribed queues based on the provided arguments.publishMany(FanoutPublishArgs<V> args) Publishes multiple messages to all subscribed queues based on the provided arguments.reactor.core.publisher.Mono<Void> removeFilter(String name) Removes a filter for the specified queue name .reactor.core.publisher.Mono<Void> setFilter(String name, MessageFilter<V> filter) Sets a filter that is applied to all messages published to the queue through this fanout.reactor.core.publisher.Mono<Boolean> subscribeQueue(String name) Subscribes a queue with the specified name to this fanout.reactor.core.publisher.Mono<Boolean> subscribeQueue(String name, MessageFilter<V> filter) Subscribes a queue with the specified name to this fanout with a filter.reactor.core.publisher.Mono<Boolean> unsubscribe(String name) Unsubscribes a queue with the specified name from this fanout.Methods inherited from interface org.redisson.api.RDestroyable
destroyMethods inherited from interface org.redisson.api.RExpirableReactive
clearExpire, expire, expire, expire, expireAt, expireAt, expireIfGreater, expireIfGreater, expireIfLess, expireIfLess, expireIfNotSet, expireIfNotSet, expireIfSet, expireIfSet, getExpireTime, remainTimeToLiveMethods inherited from interface org.redisson.api.RObjectReactive
addListener, copy, copy, copy, copyAndReplace, copyAndReplace, delete, dump, getAccessFrequency, getCodec, getIdleTime, getInternalEncoding, getName, getReferenceCount, isExists, migrate, move, removeListener, rename, renamenx, restore, restore, restoreAndReplace, restoreAndReplace, sizeInMemory, touch, unlink
-
Method Details
-
publish
Publishes a message to all subscribed queues based on the provided arguments.- Parameters:
args- arguments defining the message and publishing parameters- Returns:
- The published message, or null if the message hasn't been added to all subscribed queues. The message may not be added to a subscribed queue if the queue has size limit and is full, if message size exceeds defined queue message size limit or message rejected due to deduplication.
-
publishMany
Publishes multiple messages to all subscribed queues based on the provided arguments.- Parameters:
args- arguments defining the messages and publishing parameters- Returns:
- A list containing only messages that were added to at least a single subscribed queue. Messages may not be added to a subscribed queue if the queue has size limit and is full, if message size exceeds defined queue message size limit or message rejected due to deduplication.
-
removeFilter
Removes a filter for the specified queue name .- Parameters:
name- the queue name
-
setFilter
Sets a filter that is applied to all messages published to the queue through this fanout.The FanoutFilter object is replicated among all ReliableFanout objects and applied on each of them during message publishing.
- Parameters:
name- the queue namefilter- applied to messages
-
isSubscribed
Checks if a queue with the specified name is subscribed to this fanout.- Parameters:
name- the queue name- Returns:
trueif the queue is subscribed,falseotherwise
-
subscribeQueue
Subscribes a queue with the specified name to this fanout.- Parameters:
name- the queue name- Returns:
trueif the queue was subscribed,falseif queue is already subscribed
-
subscribeQueue
Subscribes a queue with the specified name to this fanout with a filter.- Parameters:
name- the queue namefilter- the filter that is applied to all messages published through this fanout- Returns:
trueif the queue was subscribed,falseif queue is already subscribed
-
unsubscribe
Unsubscribes a queue with the specified name from this fanout.- Parameters:
name- the queue name- Returns:
trueif the queue was unsubscribed,falseif the queue isn't subscribed
-
getSubscribers
Returns a list of the names of all subscribers to this fanout.- Returns:
- subscriber names
-
countSubscribers
reactor.core.publisher.Mono<Integer> countSubscribers()Returns amount of subscribers to this fanout.- Returns:
- amount of subscribers
-