Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/main/java/io/nats/client/ConnectionListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public String toString() {
* @param type the type of event that has occurred
* @param uriDetails extra details about the uri related to this connection event
*/
default void connectionEvent(Connection conn, Events type, String uriDetails) {
default void connectionEvent(Connection conn, Events type, Long time, String uriDetails) {
connectionEvent(conn, type);
}
}
3 changes: 2 additions & 1 deletion src/main/java/io/nats/client/impl/NatsConnection.java
Original file line number Diff line number Diff line change
Expand Up @@ -1975,10 +1975,11 @@ String uriDetail(NatsUri uri, NatsUri hostOrlast) {
void processConnectionEvent(Events type, String uriDetails) {
if (!this.callbackRunner.isShutdown()) {
try {
long time = System.currentTimeMillis();
for (ConnectionListener listener : connectionListeners) {
this.callbackRunner.execute(() -> {
try {
listener.connectionEvent(this, type, uriDetails);
listener.connectionEvent(this, type, time, uriDetails);
} catch (Exception ex) {
this.statistics.incrementExceptionCount();
}
Expand Down
Loading