spring-projects / spring-projects/spring-framework

spring-jms DefaultMessageListenerContainer when using retries cause comes as null in Dead Letter Queue using ActiveMQ

Open
#22,817 11 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

in: messaging status: waiting-for-triage
Dominant language
Java
Stars
60.2k
Forks
38.8k
Avg merge
5d 2h
Merged PRs (30d)
27

Description

Hi Spring community,

I'm implementing retries with a DLQ in spring, I'm using the DefaultMessageListenerContainer but not the SimpleMessageListenerContainer, when the retries exceed the message in the DLQ looks like the following:

java.lang.Throwable: Delivery[2] exceeds redelivery policy imit:RedeliveryPolicy
{destination = queue://*,
collisionAvoidanceFactor = 0.15,
maximumRedeliveries = 1,
maximumRedeliveryDelay = -1,
initialRedeliveryDelay = 10000,
useCollisionAvoidance = false,
useExponentialBackOff = true,
backOffMultiplier = 5.0,
redeliveryDelay = 10000,
preDispatchCheck = true},
cause:null

the cause:null should be coming back with the exception that happened in the consumer but it doesn't, apparently in spring we are swallowing the exception (in the DefaultMessageListenerContainer) and ActiveMQ cannot remember the cause as per: http://activemq.2283324.n4.nabble.com/ActiveMQ-5-5-Not-able-to-get-the-DLQ-DELIVERY-FAILURE-CAUSE-PROPERTY-value-td3492931.html.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with DefaultMessageListenerContainer and compare its retry and exception handling with SimpleMessageListenerContainer. Reproduce the ActiveMQ DLQ flow using the stated redelivery policy, then verify that a consumer exception is preserved in the DLQ delivery-failure cause instead of appearing as cause:null.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring
Domain
backend, distributed-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.