Skip to content

Commit

Permalink
fix: clean app subscriptions on reconfigure
Browse files Browse the repository at this point in the history
Signed-off-by: dorjesinpo <[email protected]>
  • Loading branch information
dorjesinpo committed Oct 16, 2024
1 parent 71b4dab commit 302149c
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/groups/mqb/mqbblp/mqbblp_rootqueueengine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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);

Expand Down

0 comments on commit 302149c

Please sign in to comment.