Announcement Announcement Module
No announcement yet.
Spring Data Redis pub/sub unsubscribe Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring Data Redis pub/sub unsubscribe

    I'm using Spring Data Redis 1.0.2.RELEASE pub/sub functionality via the RedisMessageListenerContainer Class. This Class handles the Redis connection listening and multi-threaded task dispatching. It provides a way to subscribe to a Redis channel by adding a listener but doesn't provide a way to unsubscribe to a Redis channel.

    The underlying SubscriptionTask Class does have methods to unsubscribe to channels but this is a private instance member of RedisMessageListenerContainer and there isn't a clean way to get at it.

    What's the best way to unsubscribe to a Redis channel using Spring Data Redis?

  • #2
    Looks like we forgot to expose this functionality on the message listener container. Can you please raise an issue? We could ship it with the next release (and potentially address scripting in Redis 2.6 through a separate milestone).

    In the meantime, as a workaround, you could stop the container, set the listener again on it and start it again. It's clunky but it should work.



    • #3
      The feature has made it into the trunk - feedback welcome.