Results 1 to 4 of 4

Thread: Redis listener container: mixing topic and pattern

  1. #1
    Join Date
    Jan 2012
    Posts
    2

    Default Redis listener container: mixing topic and pattern

    when trying to create a listener container with both pattern and topic listeners I get exception:

    Code:
    <redis:listener-container connection-factory="connectionFactory" >
            <!-- the method attribute can be skipped as the default method name is "handleMessage" -->
            <redis:listener ref="logMessageDelegate" method="handleMessage" topic="logChannel:*" />
            <redis:listener ref="contentScraperDelegate" method="onMessage" topic="logChannel" />
    </redis:listener-container>

    Exception:

    Exception in thread "org.springframework.data.redis.listener.RedisMess ageListenerContainer#0-1" org.springframework.dao.InvalidDataAccessApiUsageE xception: ERR multi bulk protocol error; nested exception is redis.clients.jedis.exceptions.JedisDataException: ERR multi bulk protocol error
    at org.springframework.data.redis.connection.jedis.Je disUtils.convertJedisAccessException(JedisUtils.ja va:72)
    at org.springframework.data.redis.connection.jedis.Je disConnection.convertJedisAccessException(JedisCon nection.java:113)
    at org.springframework.data.redis.connection.jedis.Je disConnection.subscribe(JedisConnection.java:2341)
    at org.springframework.data.redis.listener.RedisMessa geListenerContainer$SubscriptionTask.run(RedisMess ageListenerContainer.java:573)
    at java.lang.Thread.run(Thread.java:662)
    Caused by: redis.clients.jedis.exceptions.JedisDataException: ERR multi bulk protocol error
    at redis.clients.jedis.Protocol.processError(Protocol .java:54)
    at redis.clients.jedis.Protocol.process(Protocol.java :61)
    at redis.clients.jedis.Protocol.read(Protocol.java:12 2)
    at redis.clients.jedis.Connection.getObjectMultiBulkR eply(Connection.java:196)
    at redis.clients.jedis.BinaryJedisPubSub.process(Bina ryJedisPubSub.java:80)
    at redis.clients.jedis.BinaryJedisPubSub.proceed(Bina ryJedisPubSub.java:75)
    at redis.clients.jedis.BinaryJedis.subscribe(BinaryJe dis.java:2997)
    at org.springframework.data.redis.connection.jedis.Je disConnection.subscribe(JedisConnection.java:2338)
    ... 2 more

    If I use both pattern listeners or both topic listeners it works OK.
    I could not find anything in the documentation about this.

    Code:
    <redis:listener-container connection-factory="connectionFactory" >
            <!-- the method attribute can be skipped as the default method name is "handleMessage" -->
            <redis:listener ref="logMessageDelegate" method="handleMessage" topic="logChannel:*" />
            <redis:listener ref="contentScraperDelegate" method="onMessage" topic="logChannel:*" />
        </redis:listener-container>

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

    Default

    Seems like that driver doesn't like missing different types of channels. Can you update Jedis to the latest version and report back?
    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 2012
    Posts
    2

    Default

    I have not set up a linux machine yet so I am working with redis for windows which does not go beyond version 2.0.0.
    But if it a version issue I can live with it.
    I will check the issue once I have my linux set up.
    Thanks,

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

    Default

    You should be able to update Jedis to 2.1 without issues. As for Redis, try the unofficial Redis port which currently is at 2.4.x: https://github.com/dmajkic/redis/
    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

Tags for this Thread

Posting Permissions

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