Skip to content

Publish Event In Container when Authorization/Authentication Exception occurs and retry takes place #2284

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

Closed
indraneelb1903 opened this issue May 25, 2022 · 5 comments · Fixed by #2317
Labels
ideal-for-user-contribution An issue that would ideal for a user to get started with contributing. type: enhancement
Milestone

Comments

@indraneelb1903
Copy link

indraneelb1903 commented May 25, 2022

Hi @garyrussell and @artembilan

I am using spring kafka and i need to do something when kafka connection error happens due to authorization/authentication exception been thrown in the following class - https://github.com/spring-projects/spring-kafka/blob/main/spring-kafka/src/main/java/org/springframework/kafka/listener/KafkaMessageListenerContainer.java

No , i do not want the container to stop , hence i have the authExceptionRetryInterval set. But what i would also like is an application event to be published when this kind of error occurs so i can listen on it and then do something custom.

Also , i would also like an event to be published when the connection is successfully restored in the pollAndInvoke() method in the same class. Please let me know your thoughts on the same and if you guys are open to such a change.

@artembilan
Copy link
Member

i think this make sense.

I'm not sure yet in the implementation details, but I'm OK to accept this as a Feature Request.

Let's also here from @garyrussell next week when he comes back from vacation!

@garyrussell garyrussell added this to the 3.0 Backlog milestone May 31, 2022
@garyrussell
Copy link
Contributor

Yes, it makes sense; feel free to submit a PR.

@garyrussell garyrussell added the ideal-for-user-contribution An issue that would ideal for a user to get started with contributing. label May 31, 2022
danielgentes added a commit to danielgentes/spring-kafka that referenced this issue Jun 22, 2022
danielgentes added a commit to danielgentes/spring-kafka that referenced this issue Jun 23, 2022
danielgentes added a commit to danielgentes/spring-kafka that referenced this issue Jun 23, 2022
danielgentes added a commit to danielgentes/spring-kafka that referenced this issue Jun 23, 2022
danielgentes added a commit to danielgentes/spring-kafka that referenced this issue Jun 23, 2022
danielgentes added a commit to danielgentes/spring-kafka that referenced this issue Jun 23, 2022
danielgentes added a commit to danielgentes/spring-kafka that referenced this issue Jun 23, 2022
danielgentes added a commit to danielgentes/spring-kafka that referenced this issue Jun 23, 2022
* Added Events for auth failed
and successful retry of auth
* publish of these events
* unit testing

Closes spring-projects#2284
@danielgentes
Copy link
Contributor

Hi @garyrussell ,
found this issue and made a PR to introduce the mentioned features. Looking forward to a review and feedback.
Thanks in advance!

@indraneelb1903
Copy link
Author

Thank you for taking care of this. @danielgentes

danielgentes added a commit to danielgentes/spring-kafka that referenced this issue Jun 24, 2022
Implement review suggestions:
* new files only 2022
* copy paste error
* javadoc wrapping
@danielgentes
Copy link
Contributor

You're welcome, happy to help @indraneelb1903, I hope the changes match your expectations of the feature

danielgentes added a commit to danielgentes/spring-kafka that referenced this issue Jun 24, 2022
Implement review suggestions:
* remove @SInCE tags not at top level
* event documentation
* @author on changed classes
* corrected javadoc
@artembilan artembilan modified the milestones: 3.0 Backlog, 3.0.0.M5 Jun 24, 2022
artembilan pushed a commit that referenced this issue Jun 24, 2022
Fixes #2284

* Added Events for auth failed and successful retry of auth
* publish of these events
* unit testing
* new files only 2022
* copy paste error
* javadoc wrapping
* remove `@since` tags not at top level
* event documentation
* `@author` on changed classes
* corrected javadoc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ideal-for-user-contribution An issue that would ideal for a user to get started with contributing. type: enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants