Merge pull request #2383 from hapifhir/ng_mdm_channel_restart_fix

Fixed orphaned channel on restart
This commit is contained in:
Nick Goupinets 2021-02-12 15:52:23 -05:00 committed by GitHub
commit 98b4141b1b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -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());
}
}