Results 1 to 3 of 3

Thread: Spring Data Redis pub/sub unsubscribe

  1. #1
    Join Date
    Dec 2012
    Posts
    3

    Default 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. #2
    Join Date
    Jan 2005
    Location
    Bucharest, Romania
    Posts
    5,403

    Default

    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.

    Thanks,
    Costin Leau
    SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
    http://twitter.com/costinl
    Please use [ c o d e ] [ / c o d e ] tags

  3. #3
    Join Date
    Jan 2005
    Location
    Bucharest, Romania
    Posts
    5,403

    Default

    https://jira.springsource.org/browse/DATAREDIS-107
    The feature has made it into the trunk - feedback welcome.
    Costin Leau
    SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
    http://twitter.com/costinl
    Please use [ c o d e ] [ / c o d e ] tags

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •