-
Notifications
You must be signed in to change notification settings - Fork 1.7k
GH-2284: Publish Auth Error Events #2317
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
GH-2284: Publish Auth Error Events #2317
Conversation
* Added Events for auth failed and successful retry of auth * publish of these events * unit testing Closes spring-projects#2284
garyrussell
left a comment
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!
Just a few minor nits.
| @@ -0,0 +1,77 @@ | |||
| /* | |||
| * Copyright 2018-2022 the original author or authors. | |||
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.
New files only need 2022.
| package org.springframework.kafka.event; | ||
|
|
||
| /** | ||
| * An event published when authentication or authorization of a consumer fails and is being retried. Contains the triggering throwable. |
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.
Please wrap javadocs at 90 chars (code at 120).
| } | ||
|
|
||
| /** | ||
| * Return the reason why the consumer was stopped. |
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.
Looks like copy/paste.
Return the reason for the auth failure.
| /** | ||
| * Return the reason why the consumer was stopped. | ||
| * @return the reason. | ||
| * @since 2.5.8 |
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.
| * @since 2.5.8 | |
| * @since 2.8.8 |
| @@ -0,0 +1,44 @@ | |||
| /* | |||
| * Copyright 2018-2022 the original author or authors. | |||
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.
2022
Implement review suggestions: * new files only 2022 * copy paste error * javadoc wrapping
|
Hi @garyrussell, |
artembilan
left a comment
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 this also has to be mention in the docs: https://docs.spring.io/spring-kafka/docs/current/reference/html/#events.
See kafka.adoc file in the project and modify its Application Events section.
| /** | ||
| * Return the reason for the auth failure. | ||
| * @return the reason. | ||
| * @since 2.8.8 |
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.
This looks like copy/paste from some other class.
Please, remove all the @since in your new classes, but leave that one on the top class level.
You have just introduced the class in 3.0, so it is @since 3.0 with all of its APIs and so on: no reason to duplicate on every method.
| } | ||
| } | ||
|
|
||
| private void publishRetryAuthEvent(Throwable throwable) { |
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.
Please, add your name to the @author list: you have made some changes to the class, so you deserve some credit.
| given(cf.createConsumer(eq("grp"), eq("clientId"), isNull(), any())).willReturn(consumer); | ||
| given(cf.getConfigurationProperties()).willReturn(new HashMap<>()); | ||
| CountDownLatch latch = new CountDownLatch(2); | ||
| CountDownLatch retryEvent = new CountDownLatch(2); |
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.
Same here: your name to the @author list.
|
Hi @artembilan , |
|
thank you for contribution; looking forward for more! |
and successful retry of auth
Closes #2284