BewareMyPower opened a new pull request #7823:
URL: https://github.com/apache/pulsar/pull/7823


   ### Motivation
   
   The current key of `MultiTopicsConsumerImpl.topics` is the topic name passed 
by user. The `topicNameValid` method checks if the name is valid and `topics` 
doesn't contain the key.
   
   However, if a multi topics consumer subscribed a partition of a subscribed 
partitioned topic,  `subscribeAsync` succeed and a new `ConsumerImpl` of the 
same partition was created, which is redundant.
   
   Also, if a multi topics consumer subscribed `public/default/topic` or 
`persistent://public/default/topic`, while the initial subscribed topic is 
`topic`, the redundant consumers would be created.
   
   ### Modifications
   
   - Use full topic name as key of `MultiTopicsConsumerImpl.topics`
   - Check both full topic name and full partitioned topic name not exist in 
`MultiTopicsConsumerImpl.topics` when `subscribeAsync` is called
   - Add a unit test for subscribing a partition of a subscribed partitioned 
topic


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to