lianetm commented on PR #15188:
URL: https://github.com/apache/kafka/pull/15188#issuecomment-1936091369

   Hey @Phuc-Hong-Tran , regarding the mixed usage of subscribe with `Pattern` 
and with `SubscriptionPattern`, my opinion is that it is something we should 
live with to provide a smooth transition, while the usage of `Pattern` is 
deprecated. So I would say that we shouldn't restrict it by throwing any new 
exception to the user (which btw, would introduce API level changes not 
included in the KIP, so it would require an updated/new KIP). We could just 
allow subsequent calls to both subscribe with Pattern or SubscriptionPattern, 
and just ensure that the latest prevails. This is the behaviour for subsequent 
calls to `subscribe(Pattern..)`, tested in 
[testSubsequentPatternSubscription](https://github.com/apache/kafka/blob/ec4a8aaadbc95cfcf0de2f5e1385373f095298ca/core/src/test/scala/integration/kafka/api/PlaintextConsumerTest.scala#L417).
  
   
   Just for the record, there is a restriction (see 
[here](https://github.com/apache/kafka/blob/ec4a8aaadbc95cfcf0de2f5e1385373f095298ca/clients/src/main/java/org/apache/kafka/clients/consumer/internals/SubscriptionState.java#L162))
 for not allowing mixed usage of subscribe, but only when mixing different 
subscription types (topics, partitions, pattern). We continue to respect that, 
without introducing any new restriction for the calls that in the end represent 
the same pattern-based subscription type (AUTO_PATTERN).  


-- 
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.

To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to