Skip to content

Conversation

@sobychacko
Copy link
Contributor

…ption

Fixes: #3884

… vs RuntimeException

Fixes: spring-projects#3884

Signed-off-by: Soby Chacko <soby.chacko@broadcom.com>
Copy link
Member

@artembilan artembilan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not critical , but pay attention how PR title looks ugly because of too long commit message head line.

The `DefaultErrorHandler` only processes exceptions that inherit from `RuntimeException`.
Exceptions inheriting from `Error` bypass the error handler entirely, causing the consumer to terminate immediately, close the Kafka connection, and skip all retry/recovery mechanisms.
This critical distinction means applications may report healthy status despite having terminated consumers that no longer process messages.
Always ensure that exceptions thrown in message processing code extend from `RuntimeException` rather than `Error` to allow proper error handling.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’m not sure how to help, but this is not true. The OutOfMemoryError is really out of our control . Do you have any advice how really we can make Error as RuntimeException? What is the goal of this sentence if we don’t provide any example how to do that ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant any exceptions thrown explicitly by the applications. I can rephrase if needed. Things like OOME are outside the application's control, and we can't help. This issue was raised because someone was accidentally placed Kotlin's TODO method that throws an Error. This clarification is basically to navigate the users of those scenarios.

Signed-off-by: Soby Chacko <soby.chacko@broadcom.com>
Signed-off-by: Artem Bilan <artem.bilan@broadcom.com>
@artembilan artembilan merged commit 00de4f6 into spring-projects:main May 7, 2025
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Documentation: Clarify exception handlings behaviour for Error vs RuntimeException

2 participants