diff --git a/smallrye-reactive-messaging-amqp/src/main/java/io/smallrye/reactive/messaging/amqp/AmqpConnector.java b/smallrye-reactive-messaging-amqp/src/main/java/io/smallrye/reactive/messaging/amqp/AmqpConnector.java index 5d775d6d8a..da838351cd 100644 --- a/smallrye-reactive-messaging-amqp/src/main/java/io/smallrye/reactive/messaging/amqp/AmqpConnector.java +++ b/smallrye-reactive-messaging-amqp/src/main/java/io/smallrye/reactive/messaging/amqp/AmqpConnector.java @@ -349,7 +349,11 @@ public List 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(); }