Skip to content

Commit

Permalink
Exception handling
Browse files Browse the repository at this point in the history
Fixed exception handling. Making sure the original connection exception is visible.
  • Loading branch information
roeschter committed Nov 15, 2024
1 parent 87cdd45 commit 1c1fb79
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/main/java/io/nats/client/impl/NatsMessageConsumer.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,16 @@ void doSub() throws JetStreamApiException, IOException {
finished.set(false);
}
catch (JetStreamApiException | IOException e) {
setupHbAlarmToTrigger();
setupHbAlarmToTrigger();
throw e;
}
}

private void setupHbAlarmToTrigger() {
pmm.resetTracking();
pmm.initOrResetHeartbeatTimer();
if ( pmm != null) {
pmm.resetTracking();
pmm.initOrResetHeartbeatTimer();
}
}

@Override
Expand Down

0 comments on commit 1c1fb79

Please sign in to comment.