question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

general way of catching connection related lettuce redis exceptions

See original GitHub issue

Hi. I am trying to implement my own custom reconnection logic handling such that whenever there are any exceptions throwing related to connection problem it will trigger this custom reconnection logic to create a new lettuce client (through Load Balancer). Is there a general way to catch all connection related exceptions? I have seen many connection problem that are instanceof RedisException (which is very general). Can you offer any tips? I am currently using lettuce connection pooling as my client

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
mp911decommented, Apr 28, 2022

For that case, please configure a custom SocketAddressResolver. DNS resolvers might not be used when using e.g. domain sockets.

0reactions
ExploreNcrackcommented, Apr 27, 2022

Hi @mp911de so do you think that I can customize the autoreconnect behavior such that whenever connect or reconnect is triggered it will invoke the custom connect logic with DefaultClientResources.builder().dnsResolver(host -> custom_reconnect_logic(host))? Cuz for autoreconnect I don’t want it to just try reconnect to the same server node that was configured in redis uri initially, but to a different server node [through load balancer to find the next available server node to connect to] (the custom reconnect logic)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Lettuce Reference Guide
Host and port mappers for Lettuce usage behind connection tunnels/proxies through SocketAddressResolver , see Configuring Client resources.
Read more >
Error: io.lettuce.core.RedisConnectionException Unable to ...
the redis server is running locally. The book didn't specify where to put the redis host name and port so I think it's...
Read more >
Spring Data Redis
Lettuce is a Netty-based open-source connector supported by Spring Data Redis through the org.springframework.data.redis.connection.lettuce ...
Read more >
lettuce-io/Lobby - Gitter
RELEASE ,when i start my service i can connect redis client ,but , if i dont use ,ten or more minutes later ,...
Read more >
Redis Lettuce integration with Java Spring Boot | BytePitch
Looking at the client options, we will simply reject any requests to Redis in disconnected state while attempting to automatically reconnect to ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found