Announcement Announcement Module
Collapse
No announcement yet.
Redis listener container: mixing topic and pattern Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

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

    Comment


    • #3
      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,

      Comment


      • #4
        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/

        Comment

        Working...
        X