Skip to content

Commit

Permalink
feature_Support_reconnect_backoff_interface
Browse files Browse the repository at this point in the history
  • Loading branch information
cmgyqjj committed Sep 23, 2024
1 parent 3446b87 commit 50eccb0
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -224,11 +224,13 @@ public void testReconnect() throws Exception {
.userName(zs)
.userId(zsId)
.build();
var backoffStrategy = "com.crossoverjie.cim.client.sdk.io.backoff.RandomBackoff";

@Cleanup
Client client1 = Client.builder()
.auth(auth1)
.routeUrl(routeUrl)
.backoffStrategy(backoffStrategy)
.build();
TimeUnit.SECONDS.sleep(3);
ClientState.State state = client1.getState();
Expand All @@ -242,6 +244,7 @@ public void testReconnect() throws Exception {
.auth(auth2)
.routeUrl(routeUrl)
.messageListener((client, message) -> client2Receive.set(message))
.backoffStrategy(backoffStrategy)
.build();
TimeUnit.SECONDS.sleep(3);
ClientState.State state2 = client2.getState();
Expand Down

0 comments on commit 50eccb0

Please sign in to comment.