spring-projects / spring-projects/spring-data-redis
Configuration builder should offer a way to configure the current state [DATAREDIS-1131]
@christophstrobl is already working on this.
Since Dec 30, 2020.
- Dominant language
- Java
- Stars
- 1.9k
- Forks
- 1.3k
- PR merge metrics
- No merged PRs in 30d
Description
Mark Paluch opened DATAREDIS-1131 and commented
This is a follow-up of spring-projects/spring-boot#15630
As part of this issue, Spring Boot alters the ClusterTopologyRefreshOptions that's part of the ClientOptions. Spring Boot also provides a LettuceClientConfigurationBuilderCustomizer with the ability to tune the configuration.
The problem with this approach is that LettuceClientConfigurationBuilder.clientOptions() let me set a new ClientOptions, erasing anything else that was previously configured. I considered adding an extra customizer for options but this feels to me that's something Lettuce should handle directly.
Describe the solution you'd like
Another approach could be callback style where we'd keep the builder rather than the result options and let users customize it, something like:
builder.clientOptions((options) -> options.socketOptions((socket) -> socket.tcpNoDelay(false)));
The call above would keep any customization as is as only the tcpNoDelay property of the socket options would change.
Describe alternatives you've considered
An alternative to this is to get the ClientOptions (by building the configuration) and then reinitializing a ClientOptions.Builder based on an instance.
Originally reported by Stéphane Nicoll
No further details from DATAREDIS-1131
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.