-
Notifications
You must be signed in to change notification settings - Fork 150
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
Log connect trace server uri when reconnecting #1106
Conversation
.traceConnection() | ||
.timeTraceLogger(l) | ||
.reconnectWait(Duration.ofSeconds(1)) | ||
.maxReconnects(1) |
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.
Limits the number of reconnect attempts for testing.
|
||
try (Connection nc = Nats.connect(options)) { | ||
assertConnected(nc); | ||
ts.close(); |
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.
Close the test server to trigger a reconnect attempt
try (Connection nc = Nats.connect(options)) { | ||
assertConnected(nc); | ||
ts.close(); | ||
Thread.sleep(3000); |
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.
Waits for a reconnect attempt to occur
@@ -317,6 +317,7 @@ else if (first.equals(cur)) { | |||
updateStatus(Status.RECONNECTING); | |||
|
|||
NatsUri resolved = resolvedList.remove(0); | |||
timeTraceLogger.trace("reconnecting to server %s", resolved.toString()); |
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.
To be consistent, this trace should be before the previous line.
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
Linked Issue here