-
Notifications
You must be signed in to change notification settings - Fork 116
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
#270 support prefix for producer transaction id and consumer group #279
#270 support prefix for producer transaction id and consumer group #279
Conversation
… id and consumer group
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.
Thanks a lot for your contribution! I appreciate it a ton! left only small cosmetic comments 👍
src/main/java/com/purbon/kafka/topology/model/users/Consumer.java
Outdated
Show resolved
Hide resolved
src/main/java/com/purbon/kafka/topology/model/users/Producer.java
Outdated
Show resolved
Hide resolved
Nope! I mean have a master constructor where you set all class attributes
and a secondary constructor that can call this main one.
…-- Pere
Missatge de Magnus Smith ***@***.***> del dia dc., 5 de maig
2021 a les 16:16:
***@***.**** commented on this pull request.
------------------------------
In src/main/java/com/purbon/kafka/topology/model/users/Consumer.java
<#279 (comment)>:
> @@ -18,6 +18,11 @@ public Consumer(String principal) {
group = Optional.empty();
@purbon <https://github.com/purbon> just to confirm are you saying to
remove the additional constructor Consumer(String principal, String group)
so instead of
Consumer consumer = new Consumer("User:foo", "foo*");
to call
Consumer consumer = new Consumer("User:foo");
consumer.setGroup(Optiona.of("foo*");
or do you mean something else?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#279 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAQXPDAB6TPJ7M27PV6E63TMFHMJANCNFSM44DA4FDQ>
.
--
Pere Urbon-Bayes
Software Architect
https://twitter.com/purbon
https://www.linkedin.com/in/purbon/
|
@purbon In the Producer and Consumer class I see Optional field values. I think these could be better expressed by for example
...
What do you think? |
I wonder about your proposal in the use of JsonProperty and JsonIgnore, can you explain why you use them? thanks a lot |
It allows to separate the underlying instance variable from the getter by telling jackson to map the instance variable rather than the getter/setter. This allows us to keep the Optional getter but removes the need for Optional parameters which tend to be bad because they cause the caller to do unnecessary boxing, can still be null anyway, and don't work well with higher order functions forcing the caller to fallback to if statements. This might be something to consider later on as part of a wider code style refactoring. |
nice, we can certainly do this in a clean-up! do you mind doing a new PR with this, and might be other nice improvements? I will, for now, merge this one, thanks a lot. |
thanks a lot for your contribution! |
Currently producer transaction id and consumer group are treated as literals. This PR addresses #270 by allowing a trailing * to denote a resource pattern type prefix
and
Since this is not changing the structure then there should not be any braking changes. Have added test cases.