Skip to content

Implement a retry for getConnection when the enableRedisKeyspaceNotificationsInitializer bean is created #2585

@daromnik

Description

@daromnik

Hello.

I got a little problem. When raising services, sometimes an error appears:

org.springframework.beans.factory.BeanCreationException: 
Error creating bean with name 'enableRedisKeyspaceNotificationsInitializer' 
defined in class path resource [org/springframework/boot/autoconfigure/session/RedisSessionConfiguration$SpringBootRedisHttpSessionConfiguration.class]: 
Invocation of init method failed; 
nested exception is org.springframework.data.redis.RedisConnectionFailureException: Unable to connect to Redis; 
nested exception is io.lettuce.core.RedisConnectionException: Unable to connect to 111.11.111.222/<unresolved>:6379

And the service does not rise: ERROR SpringApplication reportFailure - Application run failed.
But the next time you start everything starts without errors.

Is it possible to somehow retry getConnection LettuceConnectionFactory ?
Create some kind of customizer or connect to some kind of event?
I wanted the service try to get a connection several times and only then fall.

Metadata

Metadata

Assignees

Labels

for: external-projectFor an external project and not something we can fixstatus: declinedA suggestion or change that we don't feel we should currently applystatus: invalidAn issue that we don't feel is valid

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions