From 724a40c421b84bef1e7d89887c2e7c288f0cac63 Mon Sep 17 00:00:00 2001 From: Adrian Clay Date: Thu, 12 Sep 2024 11:19:13 +0100 Subject: [PATCH] Output dead letter message at INFO level In the event that an MHS inbound message cannot be processed it would be useful to be clear what happens to the message once the error happens. By outputing this at DEBUG level this message wouldn't have beeen displayed in a production like environment, making it harder for the NME to know what's happened to the corrupt message. --- CHANGELOG.md | 5 +++++ .../pss/translator/amqp/MhsDaisyChainingQueueConsumer.java | 2 +- .../nhs/adaptors/pss/translator/amqp/MhsQueueConsumer.java | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 554317730..0dcc5d6c3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ## [Unreleased] +### Fixed + +- In the event that an inbound MHS message cannot be processed and needs to be sent to the dead letter queue, the + adaptor will now emit a log message at INFO level as opposed to DEBUG level. + ## [3.0.3] - 2024-08-23 > [!NOTE] diff --git a/gp2gp-translator/src/main/java/uk/nhs/adaptors/pss/translator/amqp/MhsDaisyChainingQueueConsumer.java b/gp2gp-translator/src/main/java/uk/nhs/adaptors/pss/translator/amqp/MhsDaisyChainingQueueConsumer.java index b44b07b98..88a8bb505 100644 --- a/gp2gp-translator/src/main/java/uk/nhs/adaptors/pss/translator/amqp/MhsDaisyChainingQueueConsumer.java +++ b/gp2gp-translator/src/main/java/uk/nhs/adaptors/pss/translator/amqp/MhsDaisyChainingQueueConsumer.java @@ -39,7 +39,7 @@ public void receive(Message message, Session session) { message.acknowledge(); LOGGER.debug("Acknowledged MHSQueue message_id=[{}]", messageId); } else { - LOGGER.debug("Sending message_id=[{}] to the dead letter queue", messageId); + LOGGER.info("Sending message_id=[{}] to the dead letter queue", messageId); mhsDlqPublisher.sendToMhsDlq(message); } diff --git a/gp2gp-translator/src/main/java/uk/nhs/adaptors/pss/translator/amqp/MhsQueueConsumer.java b/gp2gp-translator/src/main/java/uk/nhs/adaptors/pss/translator/amqp/MhsQueueConsumer.java index 52edc3439..fe0262d2e 100644 --- a/gp2gp-translator/src/main/java/uk/nhs/adaptors/pss/translator/amqp/MhsQueueConsumer.java +++ b/gp2gp-translator/src/main/java/uk/nhs/adaptors/pss/translator/amqp/MhsQueueConsumer.java @@ -39,7 +39,7 @@ public void receive(Message message, Session session) { message.acknowledge(); LOGGER.debug("Acknowledged MHSQueue message_id=[{}]", messageId); } else { - LOGGER.debug("Sending message_id=[{}] to the dead letter queue", messageId); + LOGGER.info("Sending message_id=[{}] to the dead letter queue", messageId); mhsDlqPublisher.sendToMhsDlq(message); } } catch (ConversationIdNotFoundException e) {