Package org.redisson
Class RedissonShardedTopic
java.lang.Object
org.redisson.RedissonTopic
org.redisson.RedissonShardedTopic
- All Implemented Interfaces:
RShardedTopic
,RShardedTopicAsync
,RTopic
,RTopicAsync
Sharded Topic for Redis Cluster. Messages are delivered to message listeners connected to the same Topic.
- Author:
- Nikita Koksharov
-
Constructor Summary
ConstructorDescriptionRedissonShardedTopic
(Codec codec, CommandAsyncExecutor commandExecutor, String name) RedissonShardedTopic
(Codec codec, CommandAsyncExecutor commandExecutor, NameMapper nameMapper, String name) RedissonShardedTopic
(CommandAsyncExecutor commandExecutor, String name) -
Method Summary
Modifier and TypeMethodDescriptionaddListenerAsync
(RedisPubSubListener<?> pubSubListener) Returns amount of subscribers to this topic across all Redisson instances.static RedissonTopic
createRaw
(Codec codec, CommandAsyncExecutor commandExecutor, String name) publishAsync
(Object message) Publish the message to all subscribers of this topic asynchronouslyRemoves all listeners from this topicremoveListenerAsync
(Integer... listenerIds) Removes the listener byid
for listening this topicremoveListenerAsync
(MessageListener<?> listener) Removes the listener by its instanceMethods inherited from class org.redisson.RedissonTopic
addListener, addListener, addListenerAsync, addListenerAsync, countListeners, countSubscribers, createRaw, getChannelNames, getName, publish, removeAllListeners, removeListener, removeListener
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.redisson.api.RTopic
addListener, addListener, countListeners, countSubscribers, getChannelNames, publish, removeAllListeners, removeListener, removeListener
Methods inherited from interface org.redisson.api.RTopicAsync
addListenerAsync, addListenerAsync
-
Constructor Details
-
RedissonShardedTopic
-
RedissonShardedTopic
-
RedissonShardedTopic
public RedissonShardedTopic(Codec codec, CommandAsyncExecutor commandExecutor, NameMapper nameMapper, String name)
-
-
Method Details
-
createRaw
public static RedissonTopic createRaw(Codec codec, CommandAsyncExecutor commandExecutor, String name) -
addListenerAsync
- Overrides:
addListenerAsync
in classRedissonTopic
-
publishAsync
Description copied from interface:RTopicAsync
Publish the message to all subscribers of this topic asynchronously- Specified by:
publishAsync
in interfaceRTopicAsync
- Overrides:
publishAsync
in classRedissonTopic
- Parameters:
message
- to send- Returns:
- number of clients that received the message
-
removeListenerAsync
Description copied from interface:RTopicAsync
Removes the listener by its instance- Specified by:
removeListenerAsync
in interfaceRTopicAsync
- Overrides:
removeListenerAsync
in classRedissonTopic
- Parameters:
listener
- - listener instance- Returns:
- void
-
removeListenerAsync
Description copied from interface:RTopicAsync
Removes the listener byid
for listening this topic- Specified by:
removeListenerAsync
in interfaceRTopicAsync
- Overrides:
removeListenerAsync
in classRedissonTopic
- Parameters:
listenerIds
- - listener ids- Returns:
- void
-
removeAllListenersAsync
Description copied from interface:RTopicAsync
Removes all listeners from this topic- Specified by:
removeAllListenersAsync
in interfaceRTopicAsync
- Overrides:
removeAllListenersAsync
in classRedissonTopic
- Returns:
- void
-
countSubscribersAsync
Description copied from interface:RTopicAsync
Returns amount of subscribers to this topic across all Redisson instances. Each subscriber may have multiple listeners.- Specified by:
countSubscribersAsync
in interfaceRTopicAsync
- Overrides:
countSubscribersAsync
in classRedissonTopic
- Returns:
- amount of subscribers
-