From 302149c0fd12c33c3aa8cc33eeae170b5133e86b Mon Sep 17 00:00:00 2001 From: dorjesinpo <129227380+dorjesinpo@users.noreply.github.com> Date: Wed, 16 Oct 2024 17:01:13 -0400 Subject: [PATCH] fix: clean app subscriptions on reconfigure Signed-off-by: dorjesinpo <129227380+dorjesinpo@users.noreply.github.com> --- src/groups/mqb/mqbblp/mqbblp_rootqueueengine.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/groups/mqb/mqbblp/mqbblp_rootqueueengine.cpp b/src/groups/mqb/mqbblp/mqbblp_rootqueueengine.cpp index f2a362177f..ca7be941fd 100644 --- a/src/groups/mqb/mqbblp/mqbblp_rootqueueengine.cpp +++ b/src/groups/mqb/mqbblp/mqbblp_rootqueueengine.cpp @@ -415,7 +415,13 @@ int RootQueueEngine::initializeAppId(const bsl::string& appId, bsl::ostream& errorDescription, unsigned int upstreamSubQueueId) { - if (d_apps.findByKey1(appId) != d_apps.end()) { + Apps::iterator iter = d_apps.findByKey1(appId); + + if (iter != d_apps.end()) { + + mqbconfm::Expression empty(d_allocator_p); + iter->value()->setSubscription(empty); + // Don't reconfigure an AppId that is already registered. return 0; // RETURN } @@ -439,9 +445,7 @@ int RootQueueEngine::initializeAppId(const bsl::string& appId, } BSLS_ASSERT_SAFE(!appKey.isNull()); - Apps::iterator iter = makeSubStream(appId, - AppKeyCount(appKey, 0), - upstreamSubQueueId); + iter = makeSubStream(appId, AppKeyCount(appKey, 0), upstreamSubQueueId); iter->value()->authorize(appKey, ordinal);