Skip to content
This repository was archived by the owner on Jan 19, 2022. It is now read-only.

Fix duplicate error logging #465

Closed
wants to merge 1 commit into from
Closed

Fix duplicate error logging #465

wants to merge 1 commit into from

Conversation

sayembd
Copy link
Contributor

@sayembd sayembd commented Apr 20, 2019

During the processing of an exception thrown by a queue message handler method, the AbstractMethodMessageHandler always logs the error when there is no existing handler method for that exception. On the other hand, the SimpleMessageListenerContainer logs the same exception again when the message deletion policy is set to ON_SUCCESS. This results in duplicated error logging.

This commit fixes this issue by delegating exception processing to AbstractMethodMessageHandler only when there is a configured exception handler.

The AbstractMethodMessageHandler always logs an exception when there is
no handler method for a particular exception and the
SimpleMessageListenerContainer logs the same exception again when the
message deletion policy is ON_SUCCESS. This results in duplicated error
logging.

This commit fixes this issue by delegating exception processing to
AbstractMethodMessageHandler only when there is a configured handler.

Fixes: gh-394
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Apr 20, 2019
@maciejwalkowiak maciejwalkowiak added component: sqs SQS integration related issue status: in-progress An issue that being worked on and removed status: waiting-for-triage An issue we've not yet triaged labels May 31, 2020
@maciejwalkowiak
Copy link
Contributor

maciejwalkowiak commented Jun 3, 2020

Thanks @sayembd for contribution. With this change in place, when deletion policy is different than ON_SUCCESS no exception is logged. I think no matter what deletion policy is set, exception should be always logged once. I'll fix it.

@maciejwalkowiak maciejwalkowiak added status: waiting-for-feedback We need additional information before we can continue and removed status: in-progress An issue that being worked on labels Jun 3, 2020
maciejwalkowiak added a commit that referenced this pull request Jun 3, 2020
…istener.

This commit fixes this issue by delegating exception processing to
AbstractMethodMessageHandler only when there is a configured handler.
If there is none, exception is logged.

Fixes gh-394
Closes gh-465

Co-authored-by: Maciej Walkowiak <[email protected]>
tmnuwan12 pushed a commit to tmnuwan12/spring-cloud-aws that referenced this pull request Jun 7, 2020
…istener.

This commit fixes this issue by delegating exception processing to
AbstractMethodMessageHandler only when there is a configured handler.
If there is none, exception is logged.

Fixes spring-atticgh-394
Closes spring-atticgh-465

Co-authored-by: Maciej Walkowiak <[email protected]>
maciejwalkowiak added a commit to maciejwalkowiak/spring-cloud-aws that referenced this pull request Oct 15, 2020
…istener.

This commit fixes this issue by delegating exception processing to
AbstractMethodMessageHandler only when there is a configured handler.
If there is none, exception is logged.

Fixes spring-atticgh-394
Closes spring-atticgh-465

Co-authored-by: Maciej Walkowiak <[email protected]>
maciejwalkowiak added a commit to maciejwalkowiak/spring-cloud-aws that referenced this pull request Oct 15, 2020
…istener.

This commit fixes this issue by delegating exception processing to
AbstractMethodMessageHandler only when there is a configured handler.
If there is none, exception is logged.

Fixes spring-atticgh-394
Closes spring-atticgh-465

Co-authored-by: Maciej Walkowiak <[email protected]>
maciejwalkowiak added a commit to maciejwalkowiak/spring-cloud-aws that referenced this pull request Oct 15, 2020
…istener.

This commit fixes this issue by delegating exception processing to
AbstractMethodMessageHandler only when there is a configured handler.
If there is none, exception is logged.

Fixes spring-attic#394
Closes spring-attic#465

Co-authored-by: Maciej Walkowiak <[email protected]>
maciejwalkowiak added a commit to maciejwalkowiak/spring-cloud-aws that referenced this pull request Oct 15, 2020
…istener.

This commit fixes this issue by delegating exception processing to
AbstractMethodMessageHandler only when there is a configured handler.
If there is none, exception is logged.

Fixes spring-attic#394
Closes spring-attic#465

Co-authored-by: Maciej Walkowiak <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
component: sqs SQS integration related issue status: waiting-for-feedback We need additional information before we can continue
Development

Successfully merging this pull request may close these issues.

3 participants