-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
feature:Support_reconnect_backoff_interface #155
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
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. |
@@ -20,4 +22,5 @@ public interface ClientBuilder { | |||
ClientBuilder okHttpClient(OkHttpClient okHttpClient); | |||
ClientBuilder messageListener(MessageListener messageListener); | |||
ClientBuilder callbackThreadPool(ThreadPoolExecutor callbackThreadPool); | |||
ClientBuilder backoffStrategy(String backoffStrategy); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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()) |
There was a problem hiding this comment.
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
.
cim-client-sdk/src/main/java/com/crossoverjie/cim/client/sdk/impl/ClientBuilderImpl.java
Outdated
Show resolved
Hide resolved
Co-authored-by: crossoverJie <[email protected]>
…mpl/ClientBuilderImpl.java Co-authored-by: crossoverJie <[email protected]>
There was a problem hiding this 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.
There is a TODO item in the list: The
ClientImpl.reconnect
method requires a backoff interface. Consequently, a configuration has been added toClientConfigurationData
. This configuration will support reading the fallback strategy fromapplication.yaml
and use reflection for instantiation inClientBuilder
.