Skip to content

Commit 0a9b7d9

Browse files
authored
Fix multi-topics-consumer new topic listeners stuck in paused state (#481)
This was introduced in v3.7.0 via #447, which contained a change that attempted to fix an issue where a pre-mature ack of a message before a multi-topic subscriber was ready could have caused a crash. To fix the original bug, all multi-topic subscriptions are started with their message listener paused. They later get un-paused once all topics are successfully subscribed and connected. However, on a regex subscription when new topics are discovered, they also start in a paused state, and there's no mechanism to resume them. Hence, they get stuck, and no messages for new topics will be processed. This change adds a call to resume any new listeners after new topics are added.
1 parent fca3827 commit 0a9b7d9

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/PatternMultiTopicsConsumerImpl.cc

+3
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,9 @@ void PatternMultiTopicsConsumerImpl::timerGetTopicsOfNamespace(const Result resu
118118
// callback method when added topics all subscribed.
119119
ResultCallback topicsAddedCallback = [this, topicsRemoved, topicsRemovedCallback](Result result) {
120120
if (result == ResultOk) {
121+
if (messageListener_) {
122+
resumeMessageListener();
123+
}
121124
// call to unsubscribe all removed topics.
122125
onTopicsRemoved(topicsRemoved, topicsRemovedCallback);
123126
} else {

0 commit comments

Comments
 (0)