diff --git a/src/main/java/org/springframework/data/redis/core/ReactiveRedisOperations.java b/src/main/java/org/springframework/data/redis/core/ReactiveRedisOperations.java index 88e06f0d5..c02d1eea8 100644 --- a/src/main/java/org/springframework/data/redis/core/ReactiveRedisOperations.java +++ b/src/main/java/org/springframework/data/redis/core/ReactiveRedisOperations.java @@ -103,10 +103,16 @@ public interface ReactiveRedisOperations { /** * Subscribe to the given Redis {@code channels} and emit {@link Message messages} received for those. + *

+ * Note that this method allocates a new + * {@link org.springframework.data.redis.listener.ReactiveRedisMessageListenerContainer} and uses a dedicated + * connection, similar to other methods on this interface. Invoking this method multiple times is an indication that + * you should use {@link org.springframework.data.redis.listener.ReactiveRedisMessageListenerContainer} directly. * * @param channels must not be {@literal null}. * @return a hot sequence of {@link Message messages}. * @since 2.1 + * @see org.springframework.data.redis.listener.ReactiveRedisMessageListenerContainer */ default Flux> listenToChannel(String... channels) { @@ -118,10 +124,16 @@ public interface ReactiveRedisOperations { /** * Subscribe to the Redis channels matching the given {@code pattern} and emit {@link Message messages} received for * those. + *

+ * Note that this method allocates a new + * {@link org.springframework.data.redis.listener.ReactiveRedisMessageListenerContainer} and uses a dedicated + * connection, similar to other methods on this interface. Invoking this method multiple times is an indication that + * you should use {@link org.springframework.data.redis.listener.ReactiveRedisMessageListenerContainer} directly. * * @param patterns must not be {@literal null}. * @return a hot sequence of {@link Message messages}. * @since 2.1 + * @see org.springframework.data.redis.listener.ReactiveRedisMessageListenerContainer */ default Flux> listenToPattern(String... patterns) { @@ -132,16 +144,27 @@ public interface ReactiveRedisOperations { /** * Subscribe to the Redis channels for the given {@link Topic topics} and emit {@link Message messages} received for * those. + *

+ * Note that this method allocates a new + * {@link org.springframework.data.redis.listener.ReactiveRedisMessageListenerContainer} and uses a dedicated + * connection, similar to other methods on this interface. Invoking this method multiple times is an indication that + * you should use {@link org.springframework.data.redis.listener.ReactiveRedisMessageListenerContainer} directly. * * @param topics must not be {@literal null}. * @return a hot sequence of {@link Message messages}. * @since 2.1 + * @see org.springframework.data.redis.listener.ReactiveRedisMessageListenerContainer */ Flux> listenTo(Topic... topics); /** * Subscribe to the given Redis {@code channels} and emit {@link Message messages} received for those. The * {@link Mono} completes once the {@link Topic topic} subscriptions are registered. + *

+ * Note that this method allocates a new + * {@link org.springframework.data.redis.listener.ReactiveRedisMessageListenerContainer} and uses a dedicated + * connection, similar to other methods on this interface. Invoking this method multiple times is an indication that + * you should use {@link org.springframework.data.redis.listener.ReactiveRedisMessageListenerContainer} directly. * * @param channels must not be {@literal null}. * @return a hot sequence of {@link Message messages}. @@ -158,6 +181,11 @@ public interface ReactiveRedisOperations { /** * Subscribe to the Redis channels matching the given {@code pattern} and emit {@link Message messages} received for * those. The {@link Mono} completes once the {@link Topic topic} subscriptions are registered. + *

+ * Note that this method allocates a new + * {@link org.springframework.data.redis.listener.ReactiveRedisMessageListenerContainer} and uses a dedicated + * connection, similar to other methods on this interface. Invoking this method multiple times is an indication that + * you should use {@link org.springframework.data.redis.listener.ReactiveRedisMessageListenerContainer} directly. * * @param patterns must not be {@literal null}. * @return a hot sequence of {@link Message messages}. @@ -173,6 +201,11 @@ public interface ReactiveRedisOperations { /** * Subscribe to the Redis channels for the given {@link Topic topics} and emit {@link Message messages} received for * those. The {@link Mono} completes once the {@link Topic topic} subscriptions are registered. + *

+ * Note that this method allocates a new + * {@link org.springframework.data.redis.listener.ReactiveRedisMessageListenerContainer} and uses a dedicated + * connection, similar to other methods on this interface. Invoking this method multiple times is an indication that + * you should use {@link org.springframework.data.redis.listener.ReactiveRedisMessageListenerContainer} directly. * * @param topics must not be {@literal null}. * @return a hot sequence of {@link Message messages}.