Quantcast
Channel: Active questions tagged redis+java - Stack Overflow
Viewing all articles
Browse latest Browse all 2204

Spring boot application cannot reconnect to Redis and find Consumer group

$
0
0

There is a Spring Boot application which is part if a micro-service environment (Kubernetes) and connects to Redis, when all the microservices are booted up the application works fine, however when the Redis goes down or is restarted, the spring boot application, which is a Redis consumer, stops working and gives an error complaining that there is no key or Consumer group found. Logs attached below.

Does anyone know how this can be solved or is there some Redis configuration that can help auto reconnect a Redis consumer (spring boot application) along with its consumer groups to Redis.

The spring boot application uses jedis, lettuce-core and spring-data-redis dependecies.

12:33:35.609 [SimpleAsyncTaskExecutor-1] ERROR o.s.d.r.s.DefaultStreamMessageListenerContainer$LoggingErrorHandler - Unexpected error occurred in scheduled task.org.springframework.data.redis.RedisSystemException: Error in execution; nested exception is io.lettuce.core.RedisCommandExecutionException: NOGROUP No such key 'xxxxxxxxx' or consumer group 'yyyyyyyyyyyy' in XREADGROUP with GROUP optionat org.springframework.data.redis.connection.lettuce.LettuceExceptionConverter.convert(LettuceExceptionConverter.java:54)at org.springframework.data.redis.connection.lettuce.LettuceExceptionConverter.convert(LettuceExceptionConverter.java:52)at org.springframework.data.redis.connection.lettuce.LettuceExceptionConverter.convert(LettuceExceptionConverter.java:41)at org.springframework.data.redis.PassThroughExceptionTranslationStrategy.translate(PassThroughExceptionTranslationStrategy.java:44)at org.springframework.data.redis.FallbackExceptionTranslationStrategy.translate(FallbackExceptionTranslationStrategy.java:42)at org.springframework.data.redis.connection.lettuce.LettuceConnection.convertLettuceAccessException(LettuceConnection.java:273)at org.springframework.data.redis.connection.lettuce.LettuceStreamCommands.convertLettuceAccessException(LettuceStreamCommands.java:711)at org.springframework.data.redis.connection.lettuce.LettuceStreamCommands.xReadGroup(LettuceStreamCommands.java:601)at org.springframework.data.redis.connection.DefaultedRedisConnection.xReadGroup(DefaultedRedisConnection.java:591)at org.springframework.data.redis.core.DefaultStreamOperations$4.inRedis(DefaultStreamOperations.java:310)at org.springframework.data.redis.core.DefaultStreamOperations$RecordDeserializingRedisCallback.doInRedis(DefaultStreamOperations.java:376)at org.springframework.data.redis.core.DefaultStreamOperations$RecordDeserializingRedisCallback.doInRedis(DefaultStreamOperations.java:371)at org.springframework.data.redis.core.RedisTemplate.execute(RedisTemplate.java:228)at org.springframework.data.redis.core.RedisTemplate.execute(RedisTemplate.java:188)at org.springframework.data.redis.core.AbstractOperations.execute(AbstractOperations.java:96)at org.springframework.data.redis.core.DefaultStreamOperations.read(DefaultStreamOperations.java:305)at org.springframework.data.redis.stream.DefaultStreamMessageListenerContainer.lambda$getReadFunction$3(DefaultStreamMessageListenerContainer.java:236)at org.springframework.data.redis.stream.StreamPollTask.doLoop(StreamPollTask.java:138)at org.springframework.data.redis.stream.StreamPollTask.run(StreamPollTask.java:123)at java.lang.Thread.run(Thread.java:748)Caused by: io.lettuce.core.RedisCommandExecutionException: NOGROUP No such key 'xxxxxxxxx' or consumer group 'yyyyyyyyyy' in XREADGROUP with GROUP optionat io.lettuce.core.ExceptionFactory.createExecutionException(ExceptionFactory.java:135)at io.lettuce.core.ExceptionFactory.createExecutionException(ExceptionFactory.java:108)at io.lettuce.core.protocol.AsyncCommand.completeResult(AsyncCommand.java:118)at io.lettuce.core.protocol.AsyncCommand.complete(AsyncCommand.java:109)at io.lettuce.core.protocol.CommandWrapper.complete(CommandWrapper.java:59)at io.lettuce.core.protocol.CommandHandler.complete(CommandHandler.java:680)at io.lettuce.core.protocol.CommandHandler.decode(CommandHandler.java:640)at io.lettuce.core.protocol.CommandHandler.channelRead(CommandHandler.java:591)at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:163)at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:714)at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:650)at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:576)at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493)at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)... 1 common frames omitted


Viewing all articles
Browse latest Browse all 2204

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>