Phuc-Hong-Tran commented on PR #15188:
URL: https://github.com/apache/kafka/pull/15188#issuecomment-1941295224

   > > @cadonna @lianetm, since we're supporting for both subscribe method 
using java.util.regex.Pattern and SubscriptionPattern, I think we should throw 
a illegal heartbeat exeption when user try to use both method at the same time 
and inform the user to use once at a time, since the field SubscribedRegex is 
used for java.util.regex.Pattern as well as SubscriptionPattern. What do you 
guys think?
   > 
   > 
   > 
   > IMO, we must support the deprecated pattern subscriptions with 
`java.util.regex.Pattern` to ensure backwards compatibility, but we do not need 
to support mixed usage of `java.util.regex.Pattern` and Google regex patterns. 
I think this is a blind spot in the KIP. I propose to throw an 
`IllegalStateException` if `subscribe(java.util.regex.Pattern)` is called after 
`subscribe(SubscriptionPattern)` (and vice versa) without calling 
`unsubscribe()` in between. That is similar to the restrictions between 
pattern, topic, and partition subscriptions @lianetm linked above. I do not 
think it is worth to consider the edge case of mixed usage of the two pattern 
types.
   > 
   > Does this make sense to you?
   > 
   > \cc @dajac What do you as the original author of the KIP think? Should we 
update the KIP to make this clear?
   
   @cadonna that makes sense to me


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