Skip to content

Commit

Permalink
Merge pull request #2527 from cescoffier/amqp-exception-during-shutdown
Browse files Browse the repository at this point in the history
Improve AMQP Client Shutdown Error Handling
  • Loading branch information
ozangunalp authored Mar 13, 2024
2 parents 97a9960 + 5afb562 commit e40ef80
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,11 @@ public List<String> getClientCapabilities(AmqpConnectorCommonConfiguration confi
public void terminate(
@Observes(notifyObserver = Reception.IF_EXISTS) @Priority(50) @BeforeDestroyed(ApplicationScoped.class) Object event) {
processors.values().forEach(AmqpCreditBasedSender::cancel);
clients.forEach(AmqpClient::closeAndForget);
clients.forEach(c -> {
// We cannot use andForget as it could report an error is the broker is not available.
//noinspection ResultOfMethodCallIgnored
c.close().subscribeAsCompletionStage();
});
clients.clear();
}

Expand Down

0 comments on commit e40ef80

Please sign in to comment.