Skip to content

Commit

Permalink
RD: Change to reduced log messages of BrokerUtil (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
ipatini authored Nov 22, 2024
1 parent 3b8920e commit d8f0e08
Showing 1 changed file with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit d8f0e08

Please sign in to comment.