spring-data-redis icon indicating copy to clipboard operation
spring-data-redis copied to clipboard

Configuration builder should offer a way to configure the current state [DATAREDIS-1131]

Open spring-projects-issues opened this issue 5 years ago • 1 comments

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

spring-projects-issues avatar Apr 23 '20 14:04 spring-projects-issues