Uploaded image for project: 'Spring XD'
  1. Spring XD
  2. XD-2675

Add support for Sentinel in Redis Sink

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: In Progress
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 1.1 RC1
    • Fix Version/s: 1.1 GA
    • Component/s: None
    • Labels:
      None
    • Story Points:
      3
    • Rank (Obsolete):
      9223372036854775807
    • Sprint:
      Sprint 42

      Description

      Currently, the Redis sink appears to be unable to write to a Redis instance if it is connected via Sentinel. Given the following XD Container servers.yml configuration:

      # Redis properties
      spring:
        redis:
      #   port: 6379
      #   host: localhost
          sentinel:
            master: spring-xd
            nodes: 10.85.30.133:26379,10.85.30.134:26379,10.85.30.135:26379
      

      a stream of time | redis --key=ticktock results in the following:

      Created JedisPool to master at 10.85.30.130:6379
      Caused by: org.springframework.messaging.MessageHandlingException: error occurred in message handler [org.springframework.integration.redis.outbound.RedisStoreWritingMessageHandler#0]; nested exception is org.springframework.data.redis.RedisConnectionFailureException: Cannot get Jedis connection; nested exception is redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool
      Caused by: org.springframework.data.redis.RedisConnectionFailureException: Cannot get Jedis connection; nested exception is redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool
          at org.springframework.data.redis.connection.jedis.JedisConnectionFactory.fetchJedisConnector(JedisConnectionFactory.java:140)
          at org.springframework.data.redis.connection.jedis.JedisConnectionFactory.getConnection(JedisConnectionFactory.java:229)
          at org.springframework.data.redis.connection.jedis.JedisConnectionFactory.getConnection(JedisConnectionFactory.java:57)
      Caused by: redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool
          at redis.clients.jedis.JedisPool.getResource(JedisPool.java:84)
          at redis.clients.jedis.JedisPool.getResource(JedisPool.java:10)
          at org.springframework.data.redis.connection.jedis.JedisConnectionFactory.fetchJedisConnector(JedisConnectionFactory.java:133)
      Caused by: redis.clients.jedis.exceptions.JedisConnectionException: java.net.ConnectException: Connection refused
          at redis.clients.jedis.Connection.connect(Connection.java:150)
          at redis.clients.jedis.BinaryClient.connect(BinaryClient.java:71)
          at redis.clients.jedis.BinaryJedis.connect(BinaryJedis.java:1783)
          at redis.clients.jedis.JedisFactory.makeObject(JedisFactory.java:65)
          at redis.clients.jedis.Connection.connect(Connection.java:144)
      

      The parts that sticks out to me is the line

      Created JedisPool to master at 10.85.30.130:6379

      The Sentinels aren't at .130, that's a Redis and the only way that the JedisPool could know about that host is to have connected to a Sentinel instance and requested the listing of Redis nodes managed by the Sentinel. Notably, the Redis instance that the JedisPool connects to is actually responsive.

      $: redis-cli -h 10.85.30.130 -p 6379
      10.85.30.130:6379> ping
      PONG
      10.85.30.130:6379> 
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              mark.pollack Mark Pollack
              Reporter:
              nebhale nebhale
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated: