Is there any way to establish Redis connection when application starting #1714
Unanswered
charliezang
asked this question in
Q&A
Replies: 1 comment
-
I don't know how to fix that for the spring level, but we use @weblistener which extends ServletContextListener, which is being called by default when jboss server starts and that initiate connection pooling. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I've used springboot with lettuce to communicating with Redis, but I found when application started, it would not establish a connection to Redis, it would establish the connection when it need to communicate with Redis for the first time.
I could see that the first connection need more time then the rest, as the rest would use this connection.
My question is is there any way I can initialize the connection while the application starting?
here is my conf:
spring:
redis:
cluster:
nodes:
max-redirects: 5
password:
ssl: false
lettuce:
pool:
max-active: 8
max-idle: 8
min-idle: 0
max-wait: -1
I notice if I set both min-idle and time-between-eviction-runs, the min-idle would be effective.
But while application starting is this conf will initialize a connection to redis? Many Thanks
Beta Was this translation helpful? Give feedback.
All reactions