From d8f0e08346fabc925d32c1bd7ebd02bc7792faec Mon Sep 17 00:00:00 2001 From: ipatini <3739531+ipatini@users.noreply.github.com> Date: Fri, 22 Nov 2024 15:31:14 +0200 Subject: [PATCH] RD: Change to reduced log messages of BrokerUtil (#42) --- .../resource/discovery/common/BrokerUtil.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/resource-discovery/src/main/java/eu/nebulous/resource/discovery/common/BrokerUtil.java b/resource-discovery/src/main/java/eu/nebulous/resource/discovery/common/BrokerUtil.java index 0848a55..964e966 100644 --- a/resource-discovery/src/main/java/eu/nebulous/resource/discovery/common/BrokerUtil.java +++ b/resource-discovery/src/main/java/eu/nebulous/resource/discovery/common/BrokerUtil.java @@ -200,9 +200,16 @@ public void onMessage(Message message) { Object obj = objectMapper.readerFor(typeRef).readValue(payload); if (obj instanceof Map dataMap) { - log.warn("BrokerUtil: Received a new message: topic: {}", ((ActiveMQTextMessage) message).getDestination().getPhysicalName()); - log.warn("BrokerUtil: Received a new message: payload: {}", dataMap); - handlePayload(((ActiveMQTextMessage) message).getDestination().getPhysicalName(), dataMap); + String topic = ((ActiveMQTextMessage) message).getDestination().getPhysicalName(); + // Print response messages except the EMS node status reports (_ui_instance_info, _client_metrics) + if (StringUtils.isNotBlank(topic) + && ! topic.equals(properties.getDeviceStatusMonitorTopic()) + && ! topic.equals(properties.getDeviceMetricsMonitorTopic())) + { + log.warn("BrokerUtil: Received a new message: topic: {}", topic); + log.warn("BrokerUtil: Received a new message: payload: {}", dataMap); + } + handlePayload(topic, dataMap); } else { log.warn("BrokerUtil: Message payload is not recognized. Expected Map but got: type={}, object={}", obj.getClass().getName(), obj); }