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

feature:Support_reconnect_backoff_interface #155

Conversation

cmgyqjj
Copy link
Contributor

@cmgyqjj cmgyqjj commented Sep 21, 2024

There is a TODO item in the list: The ClientImpl.reconnect method requires a backoff interface. Consequently, a configuration has been added to ClientConfigurationData. This configuration will support reading the fallback strategy from application.yaml and use reflection for instantiation in ClientBuilder.

@crossoverJie crossoverJie added this to the 
v2.0.0 milestone Sep 21, 2024
@crossoverJie crossoverJie added the enhancement New feature or request label Sep 21, 2024
Copy link

codecov bot commented Sep 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 37.60%. Comparing base (29dcbea) to head (7197188).
Report is 11 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master     #155      +/-   ##
============================================
+ Coverage     37.07%   37.60%   +0.52%     
- Complexity      298      306       +8     
============================================
  Files            75       77       +2     
  Lines          2225     2234       +9     
  Branches        251      251              
============================================
+ Hits            825      840      +15     
+ Misses         1361     1356       -5     
+ Partials         39       38       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -20,4 +22,5 @@ public interface ClientBuilder {
ClientBuilder okHttpClient(OkHttpClient okHttpClient);
ClientBuilder messageListener(MessageListener messageListener);
ClientBuilder callbackThreadPool(ThreadPoolExecutor callbackThreadPool);
ClientBuilder backoffStrategy(String backoffStrategy);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ClientBuilder backoffStrategy(String backoffStrategy);
ClientBuilder backoffStrategy(BackoffStrategy backoffStrategy);

It is recommended to use the interface directly so that reflection is not needed.

@@ -61,6 +62,7 @@ public Client buildClient(@Qualifier("callBackThreadPool") ThreadPoolExecutor ca
.okHttpClient(okHttpClient)
.messageListener(new MsgCallBackListener(msgLogger))
.callbackThreadPool(callbackThreadPool)
.backoffStrategy(appConfiguration.getBackoffStrategy())
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the cim-client, frequently modifying it is a low-frequency operation, and there is no need to store it in the configuration file.
It can be similar to messageListener.

Copy link
Owner

@crossoverJie crossoverJie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for the contribution.

@crossoverJie crossoverJie merged commit 26582a9 into crossoverJie:master Sep 26, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants