From f03595d295e6413af39d33c2708537a9366a59bc Mon Sep 17 00:00:00 2001 From: Georgios Andrianakis Date: Tue, 26 Jul 2022 14:28:02 +0300 Subject: [PATCH] Don't assume that 'rabbitmq-http-port' is always set Fixes: #26873 (cherry picked from commit f6bd8994b6b4f67c9f7c1e7bf2a7d86193957215) --- .../deployment/src/main/resources/dev-templates/embedded.html | 3 +++ .../rabbitmq/runtime/devconsole/RabbitHttpPortFinder.java | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/extensions/smallrye-reactive-messaging-rabbitmq/deployment/src/main/resources/dev-templates/embedded.html b/extensions/smallrye-reactive-messaging-rabbitmq/deployment/src/main/resources/dev-templates/embedded.html index f125ba6de9c43..f4bf73bfda1f3 100644 --- a/extensions/smallrye-reactive-messaging-rabbitmq/deployment/src/main/resources/dev-templates/embedded.html +++ b/extensions/smallrye-reactive-messaging-rabbitmq/deployment/src/main/resources/dev-templates/embedded.html @@ -1,4 +1,7 @@ +{#if info:rabbitHttpPort.httpPort != null} RabbitMQ management UI {info:rabbitHttpPort.httpPort}
+{/if} + diff --git a/extensions/smallrye-reactive-messaging-rabbitmq/runtime/src/main/java/io/quarkus/smallrye/reactivemessaging/rabbitmq/runtime/devconsole/RabbitHttpPortFinder.java b/extensions/smallrye-reactive-messaging-rabbitmq/runtime/src/main/java/io/quarkus/smallrye/reactivemessaging/rabbitmq/runtime/devconsole/RabbitHttpPortFinder.java index a3161a14dc9e7..117b7e907ee7b 100644 --- a/extensions/smallrye-reactive-messaging-rabbitmq/runtime/src/main/java/io/quarkus/smallrye/reactivemessaging/rabbitmq/runtime/devconsole/RabbitHttpPortFinder.java +++ b/extensions/smallrye-reactive-messaging-rabbitmq/runtime/src/main/java/io/quarkus/smallrye/reactivemessaging/rabbitmq/runtime/devconsole/RabbitHttpPortFinder.java @@ -13,6 +13,6 @@ public class RabbitHttpPortFinder { String httpPort; void collect(@Observes StartupEvent event, Config config) { - httpPort = config.getValue("rabbitmq-http-port", String.class); + httpPort = config.getOptionalValue("rabbitmq-http-port", String.class).orElse(null); } }