Hello Claus.

I'm not sure that I should change anything on the broker side : with
the same ActiveMQ, java applications with a similar connection factory
configuration (maximumRedeliveries=0) actually do a rollback on
failing messages processing, and the broker moves them to DLQ queues.
These applications are spring boot based applications with no XA.

I don't understand why without any exception handling in my camel
route, the message is processed only once, and, as it's managed with
"auto acknowledge" (default mode), a failing message is simply read
and lost. This is a suitable behavior for almost all our use cases,
but for some of them we'd need to save failing messages in DLQ.

Another idea ???

Thanks again.

Regards.

Le lun. 11 mars 2024 à 17:07, Claus Ibsen <claus.ib...@gmail.com> a écrit :
>
> Hi
>
> You need to set this on the broker side, it's the one that does the
> redelivery.
> Every broker has their own settings for DLQ and redelivery.
>
> On Mon, Mar 11, 2024 at 2:20 PM Ephemeris Lappis <ephemeris.lap...@gmail.com>
> wrote:
>
> > Hello.
> >
> > It seems that the JMS consumer ignores the redelivery conditions that
> > I set on my route :
> >
> >         <route id=" fifi1-jms">
> >             <from
> > uri="jms:fifi1?connectionFactory=#aliceJMS&amp;transacted=true" />
> >             <transacted />
> >             <onException>
> >                 <exception>java.lang.Exception</exception>
> >                 <redeliveryPolicy disableRedelivery="true" />
> >                 <rollback markRollbackOnly="true" />
> >             </onException>
> >             <convertBodyTo type="String" />
> >             <choice>
> >                 <when>
> >                     <simple>${body} == 'BAD'</simple>
> >                     <log message="It's bad !" />
> >                     <transform>
> >                         <groovy>0 / 0</groovy>
> >                     </transform>
> >                 </when>
> >             </choice>
> >             <log message="Message has been processed : ${body}" />
> >         </route>
> >
> > In fact, the message is not rolled back but delivered 7 times. I'd
> > like the rollback put the message to a DLQ queue at the first
> > execution.
> >
> > I've tried with/without "transacted" option or/and statement, and
> > with/without "rollback" but it doesn't change anything...
> >
> > I also switched between "disableRedelivery" and "maximumRedeliveries"
> > : no difference.
> >
> > I've probably misunderstood how it works :( !
> >
> > Any experts for help ?
> >
> > Thanks in advance.
> >
> > Regards.
> >
>
>
> --
> Claus Ibsen
> -----------------
> @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2

Reply via email to