Project: springxd
Issue XD-1185: Add redisConnectionFactory with connection pool
We need to add a connection pool to the Redis connection factory used for the transport, otherwise we'll see exceptions like these: 12:57:54,842 ERROR inbound.tictoc.0-redis:queue-inbound-channel-adapter1 inbound.RedisQueueMessageDrivenEndpoint:183 - Failed to execute listening task. Will attempt to resubmit in 5000 milliseconds. org.springframework.data.redis.RedisSystemException: Redis exception; nested exception is com.lambdaworks.redis.RedisException: Unable to connect   at org.springframework.data.redis.connection.lettuce.LettuceExceptionConverter.convert(LettuceExceptionConverter.java:46)   at org.springframework.data.redis.connection.lettuce.LettuceExceptionConverter.convert(LettuceExceptionConverter.java:36)   at org.springframework.data.redis.connection.lettuce.LettuceConverters.toDataAccessException(LettuceConverters.java:159)   at org.springframework.data.redis.connection.lettuce.LettuceConnection.convertLettuceAccessException(LettuceConnection.java:253)   at org.springframework.data.redis.connection.lettuce.LettuceConnection.bRPop(LettuceConnection.java:1508)   at org.springframework.data.redis.core.DefaultListOperations$12.inRedis(DefaultListOperations.java:163)   at org.springframework.data.redis.core.AbstractOperations$ValueDeserializingRedisCallback.doInRedis(AbstractOperations.java:51)   at org.springframework.data.redis.core.RedisTemplate.execute(RedisTemplate.java:185)   at org.springframework.data.redis.core.RedisTemplate.execute(RedisTemplate.java:153)   at org.springframework.data.redis.core.AbstractOperations.execute(AbstractOperations.java:86)   at org.springframework.data.redis.core.DefaultListOperations.rightPop(DefaultListOperations.java:160)   at org.springframework.data.redis.core.DefaultBoundListOperations.rightPop(DefaultBoundListOperations.java:105)   at org.springframework.integration.redis.inbound.RedisQueueMessageDrivenEndpoint.popMessageAndSend(RedisQueueMessageDrivenEndpoint.java:178)   at org.springframework.integration.redis.inbound.RedisQueueMessageDrivenEndpoint.access$300(RedisQueueMessageDrivenEndpoint.java:51)   at org.springframework.integration.redis.inbound.RedisQueueMessageDrivenEndpoint$ListenerTask.run(RedisQueueMessageDrivenEndpoint.java:291)   at java.lang.Thread.run(Thread.java:724) Caused by: com.lambdaworks.redis.RedisException: Unable to connect   at com.lambdaworks.redis.RedisClient.connect(RedisClient.java:176)   at com.lambdaworks.redis.RedisClient.connectAsync(RedisClient.java:139)   at org.springframework.data.redis.connection.lettuce.LettuceConnection.getAsyncDedicatedConnection(LettuceConnection.java:2924)   at org.springframework.data.redis.connection.lettuce.LettuceConnection.getDedicatedConnection(LettuceConnection.java:2932)   at org.springframework.data.redis.connection.lettuce.LettuceConnection.bRPop(LettuceConnection.java:1506)   ... 11 more Caused by: java.net.BindException: Cannot assign requested address   at sun.nio.ch.Net.connect0(Native Method)   at sun.nio.ch.Net.connect(Net.java:465)   at sun.nio.ch.Net.connect(Net.java:457)   at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:639)   at org.jboss.netty.channel.socket.nio.NioClientSocketPipelineSink.connect(NioClientSocketPipelineSink.java:108)   at org.jboss.netty.channel.socket.nio.NioClientSocketPipelineSink.eventSunk(NioClientSocketPipelineSink.java:70)   at org.jboss.netty.channel.Channels.connect(Channels.java:634)   at org.jboss.netty.channel.AbstractChannel.connect(AbstractChannel.java:207)   at com.lambdaworks.redis.RedisClient.connect(RedisClient.java:165)   ... 15 more
Story points: 1