Federico Mariani created CAMEL-26983:
----------------------------------------

             Summary: camel-jms, camel-sjms: a poison message is redelivered 
through the first step and skips the dead letter channel
                 Key: CAMEL-26983
                 URL: https://issues.apache.org/jira/browse/CAMEL-26983
             Project: Camel
          Issue Type: Bug
          Components: camel-jms, camel-sjms
    Affects Versions: 4.18.5, 4.23.0, 4.22.2
            Reporter: Federico Mariani
             Fix For: 4.24.0


With {{eagerLoadingOfProperties=true}}, the consumer sets the exception of a 
poison message (payload or properties that cannot be read) on the exchange 
before routing. When the error handler has redeliveries, it takes that 
exception as a failure of the first step and redelivers that step with the 
{{eagerPoisonBody}} placeholder body. The step succeeds, so the message goes on 
through the route and never reaches the dead letter channel or {{onException}}.

{code:java}
from("jms:queue:in?eagerLoadingOfProperties=true&objectMessageEnabled=true")
    .errorHandler(deadLetterChannel("jms:queue:dead").maximumRedeliveries(2))
    .to("log:step")       // runs once, as a redelivery, with "Poison JMS 
message payload: ..."
    .to("jms:queue:out"); // gets the placeholder body, the DLC gets nothing
{code}

Expected: the poison message goes to the error handler without redeliveries 
(its payload cannot be read again), as it does with {{maximumRedeliveries(0)}}. 
camel-sjms and camel-sjms2 behave the same.

_Claude Code on behalf of Federico Mariani_



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to