-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for kafka topics regex matching #347
base: main
Are you sure you want to change the base?
Add support for kafka topics regex matching #347
Conversation
Via @ActivationConfigProperty with propertyName regexTopics
.../KafkaJCAAPI/src/main/java/fish/payara/cloud/connectors/kafka/inbound/KafkaAsynchWorker.java
Show resolved
Hide resolved
...a/KafkaJCAAPI/src/main/java/fish/payara/cloud/connectors/kafka/inbound/KafkaSynchWorker.java
Show resolved
Hide resolved
@jbndbc we don't have a signed CLA on record for you. Could you return one https://github.com/payara/Payara/blob/master/PayaraCLA.pdf |
@smillidge I have sent a signed CLA to [email protected] |
@@ -221,6 +222,14 @@ public void setTopics(String topics) { | |||
this.topics = topics; | |||
} | |||
|
|||
public String getRegexTopics() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As in the documentation the use of RegExTopics and Topics is mutually exclusive it would be good to add a check in validate and perhaps a WARNING log message if both are set to say that regextopics and topics are both set and regextopics will take precedent. That way if someone has both set they will at least get a hint as to why topics is not having any effect. Alternatively we could be brutal and throw an InvalidPropertyException stating both can not be set?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As it is, the underlying KafkaConsumer actually takes the brutal route and throws an IllegalStateException with the message that "Subscription to topics, partitions and pattern are mutually exclusive".
Would you prefer the solution with WARNING and precedence?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the precedence is done by the code already in the way the ifs are ordered. Only missing point would be the warning part.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Precedence is done via the ifs. I think I need to test creating using the admin console or via deployment rather than annotations to see if the Kafka error is enough.
Via @ActivationConfigProperty with propertyName regexTopics