spring-boot icon indicating copy to clipboard operation
spring-boot copied to clipboard

Add Redis ClientOptions Customizer

Open SOOHYUN-LIM opened this issue 10 months ago • 4 comments

The current LettuceConnectionConfiguration requires too much code to be written when additional settings such as Cluster NodeFilter are needed. Therefore, to enhance scalability, I have added a ClientOptions Customizer.

SOOHYUN-LIM avatar Apr 23 '24 06:04 SOOHYUN-LIM

@SOOHYUN-LIM Please sign the Contributor License Agreement!

Click here to manually synchronize the status of this Pull Request.

See the FAQ for frequently asked questions.

pivotal-cla avatar Apr 23 '24 06:04 pivotal-cla

@SOOHYUN-LIM Thank you for signing the Contributor License Agreement!

pivotal-cla avatar Apr 23 '24 06:04 pivotal-cla

Thanks for the proposal.

This would leave us with the existing LettuceClientConfigurationBuilderCustomizer that can customize an entire LettuceClientConfigurationBuilder and the new ClientOptionsBuilderCustomizer that can be used to customize the builder that creates the client configuration's ClientOptions. Having a second customizer that targets a subset of another customizer is unusual and I'm not 100% sure what we should do. We could:

  1. Keep things as proposed with some additions to the javadoc of LettuceClientConfigurationBuilderCustomizer to draw attention to ClientOptionsBuilderCustomizer and vice versa
  2. Maybe add a default method to the existing LettuceClientConfigurationBuilderCustomizer for customization of the client options. This may cause problems with the use of method references.
  3. Leave things as they are but this would require duplicating quite a bit of code as, particularly when using SSL, creating the client options is quite involved

1 is probably the best option but I'd like to discuss with the team.

wilkinsona avatar Apr 23 '24 07:04 wilkinsona

WE discussed this as a team and decided that option 1 is the best way to go. We'd like to rename ClientOptionsBuilderCustomizer to LettuceClientOptionsBuilderCustomizer. We can take care of that when we merge the PR.

philwebb avatar Apr 29 '24 15:04 philwebb

@SOOHYUN-LIM Thanks very much for making your first contribution to Spring Boot.

wilkinsona avatar Jun 27 '24 15:06 wilkinsona