forked from apache/pulsar
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prevent dup consumers on same client cnx with shared subscription (ap…
…ache#3312) * Prevent dup consumers on same client cnx with shared subscription Providing help trying to fix issue apache#3226. Bug description: When a client attempts to setup more than one consumer subscription on shared mode with the same subscription name, due to the validation at broker level of `consumerList.size() == 1` on canUnsubscribe() method, broker will throw an exception at the moment the client tries to unsubscribe the consumer. In order to prevent this, the proposed solution (probably not the best one) is to detect when the user is trying to setup an already subscribed consumer and return this exact same consumer instance. I believe that is quite strange to have two or more consumers with shared mode on the same connection for the same subscription, this might be due to the user confusing about consumer shared mode or behaviour, another good solution to prevent this from happening might be just throwing an invalid configuration exception. * Adapt tests for bugfix introduced in commit 44e1a23 * Add test case exploiting issue 3326 described in commit 44e1a23
- Loading branch information
Showing
12 changed files
with
272 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.