From c5342c116fbcbd1d060771cc838ed58dd243d7a7 Mon Sep 17 00:00:00 2001 From: Nick Goupinets Date: Fri, 12 Feb 2021 14:06:44 -0500 Subject: [PATCH] Fixed orphaned channel setup --- .../ca/uhn/fhir/jpa/mdm/broker/MdmQueueConsumerLoader.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hapi-fhir-jpaserver-mdm/src/main/java/ca/uhn/fhir/jpa/mdm/broker/MdmQueueConsumerLoader.java b/hapi-fhir-jpaserver-mdm/src/main/java/ca/uhn/fhir/jpa/mdm/broker/MdmQueueConsumerLoader.java index 3c19cf8b973..385d8265392 100644 --- a/hapi-fhir-jpaserver-mdm/src/main/java/ca/uhn/fhir/jpa/mdm/broker/MdmQueueConsumerLoader.java +++ b/hapi-fhir-jpaserver-mdm/src/main/java/ca/uhn/fhir/jpa/mdm/broker/MdmQueueConsumerLoader.java @@ -66,9 +66,10 @@ public class MdmQueueConsumerLoader { @SuppressWarnings("unused") @PreDestroy - public void stop() { + public void stop() throws Exception { if (myMdmChannel != null) { - myMdmChannel.unsubscribe(myMdmMessageHandler); + // JMS channel needs to be destroyed to avoid dangling receivers + myMdmChannel.destroy(); ourLog.info("MDM Matching Consumer unsubscribed from Matching Channel {} with name {}", myMdmChannel.getClass().getName(), myMdmChannel.getName()); } }