Hi I would not think you can do that, as the transacted ack mode with a rollback is just a rollback command from the JMS session. Its not like a new JMS message is being created and sent to a DLQ destination where you can provide new message headers / body etc via the JMS client and Camel.
On Fri, Aug 17, 2018 at 2:39 PM, Martin Pelikán <pelda...@gmail.com> wrote: > Hi All, > > I am trying to override/enhance JMS Message Header dlqDeliveryFailureCause > or at least add my own header with Error message when Exception occurs in > route in transacted route. > > Goal is to see Camel Exception in my message after sending to DLQ when max. > number retries is exceeded. I am wondering if it is possible to achieve it > with my configuration because my route is transacted and message is rolled > back. Do you know any way how to do it with Redelivery configured on AMQ > broker or even with letting Camel handle Redelivery with RedeliveryPolicy? > > Snippet of my configuration: > > Activemq.XML > > <destinationPolicy> > <policyMap> > <policyEntries> > <deadLetterStrategy> > <individualDeadLetterStrategy queuePrefix="DLQ." > useQueueForQueueMessages="true"/> > </deadLetterStrategy> > </policyEntry> > </policyEntries> > </policyMap> > </destinationPolicy> > > <redeliveryPlugin fallbackToDeadLetter="true" > sendToDlqIfMaxRetriesExceeded="true"> > <redeliveryPolicyMap> > <redeliveryPolicyMap> > <defaultEntry> > <redeliveryPolicy maximumRedeliveries="4" > initialRedeliveryDelay="5000" > redeliveryDelay="5000"/> > </defaultEntry> > </redeliveryPolicyMap> > </redeliveryPolicyMap> > </redeliveryPlugin> > > Blueprint.xml: > <bean id="jmsConnectionFactory" > class="org.apache.activemq.ActiveMQConnectionFactory"> > <property name="brokerURL" > value="failover:(tcp://localhost:61616,tcp://localhost:61617) /> > <property name="redeliveryPolicy" ref="amqRedeliveryPolicy" /> > </bean> > > <bean id="jmsConfig" > class="org.apache.camel.component.jms.JmsConfiguration"> > <property name="connectionFactory" > ref="pooledConnectionFactory" /> > <property name="concurrentConsumers" value="5" /> > </bean> > > <bean id="activemq" > class="org.apache.activemq.camel.component.ActiveMQComponent"> > <property name="configuration" ref="jmsConfig" /> > <property name="transacted" value="true" /> > <property name="cacheLevelName" value="CACHE_CONSUMER" /> > <property name="transactionManager" ref="jmsTransactionManager" /> > <property name="deliveryPersistent" value="true" /> > </bean> > > <bean id="jmsTransactionManager" > class="org.springframework.jms.connection.JmsTransactionManager"> > <property name="connectionFactory" ref="jmsConnectionFactory" /> > </bean> > > <bean id="amqRedeliveryPolicy" > class="org.apache.activemq.RedeliveryPolicy"> > <property name="maximumRedeliveries" value="0"/> > </bean> > > <route> > <from uri="activemq:queue:test.queue"/> > <transacted /> > <process ref="queueProcessor" /> > </route> > > Version of AMQ: 5.15.2 > Version of Camel: 2.20.1 > > Thank you. > Martin -- Claus Ibsen ----------------- http://davsclaus.com @davsclaus Camel in Action 2: https://www.manning.com/ibsen2