Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce Predicate<T extends StatefulConnection> to ConnectionPoolSupport to customize pooled connection validation #3081

Open
mp911de opened this issue Dec 16, 2024 · 0 comments
Labels
for: external-project For an external project and not something we can fix status: waiting-for-triage

Comments

@mp911de
Copy link
Collaborator

mp911de commented Dec 16, 2024

Feature Request

Is your feature request related to a problem? Please describe

It would be good to customize how pooled connections are validated. Out of the discussion at spring-projects/spring-data-redis#3067 (comment) (which boils down to defunct connections that end up with timeouts as the remote peer isn't responsive) it would be neat to customize the connection validation. Right now, RedisPooledObjectFactory.validateObject(…) performs isOpen validation.

Describe the solution you'd like

By accepting a functional interface returning a boolean flag, it would be possible that callers provide their own validation function. Having another overload of ConnectionPoolSupport.createGenericObjectPool(…) could accept either a Predicate or, better an argument object that encapsulates Predicate isValid and boolean wrapConnections.

@mp911de mp911de added the for: external-project For an external project and not something we can fix label Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
for: external-project For an external project and not something we can fix status: waiting-for-triage
Projects
None yet
Development

No branches or pull requests

2 participants