I have implemented redis for otp purposes, same redis used for triggering emails for another application using redis queue which deployed in same tomcat server. Now when I redeploy my otp service, because of this redis queue my server creates huge error log related to redis worker.
Below is the error log
at java.base/java.lang.Thread.run(Thread.java:833) 19-03-26 09:23:40.993 ERROR [pool-4-thread-1] c.v.i.c.smsemail.EmailQueueWorker - Worker error
java.lang.IllegalStateException: LettuceConnectionFactory was destroyed and cannot be used anymore
at org.springframework.util.Assert.state(Assert.java:76)
at org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory.assertInitialized(LettuceConnectionFactory.java:1245)at org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory.getConnection(LettuceConnectionFactory.java:414)
at org.springframework.data.redis.core.RedisConnectionUtils.fetchConnection(RedisConnectionUtils.java:193)
at org.springframework.data.redis.core.RedisConnectionUtils.doGetConnection(RedisConnectionUtils.java:144)
at org.springframework.data.redis.core.RedisConnectionUtils.getConnection(RedisConnectionUtils.java:105)
at org.springframework.data.redis.core.RedisTemplate.execute(RedisTemplate.java:209)
at org.springframework.data.redis.core.RedisTemplate.execute(RedisTemplate.java:189)
at org.springframework.data.redis.core.AbstractOperations.execute(AbstractOperations.java:96)
at org.springframework.data.redis.core.DefaultListOperations.rightPop(DefaultListOperations.java:239)
at com.vidalhealth.insurance.common.smsemail.EmailQueueWorker.lambda$0(EmailQueueWorker.java:142)
at co.elastic.apm.agent.concurrent.JavaConcurrent$CallableLambdaWrapper.call(JavaConcurrent.java:257)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:833) 19-03-26 09:23:40.993 ERROR [pool-4-thread-1] c.v.i.c.smsemail.EmailQueueWorker - Worker error
java.lang.IllegalStateException: LettuceConnectionFactory was destroyed and cannot be used anymore
at org.springframework.util.Assert.state(Assert.java:76)
at org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory.assertInitialized(LettuceConnectionFactory.java:1245)