I am trying to implement a strategy where when messages in an activemq queue expire, instead of being moved to the default dead letter queue ActiveMQ.DLQ, they will go another dead letter queue.
My application uses camel-context for routing and bean definition. I have looked at http://activemq.apache.org/message-redelivery-and-dlq-handling.html and I am not sure how to implement the individualDeadLetterStrategy.
I thought to try creating a Redelivery Policy bean and add that to my connection factory but I don't see a property for dead letter strategy here http://activemq.apache.org/redelivery-policy.html
I also considered using an error handler but my use case is not an error scenario.
My question is how do I configure/specify a dead-letter-queue for an individual queue.
I have configured my application to produce to the queue like this
<route id="myRoute">
<from uri="direct:insertToQueue" />
<doTry>
<bean ref="processorBean" method="getQueueRequest"/>
<to uri="activemqProducer:queue:myQueue" />
<doCatch>
<exception>java.lang.Exception</exception>
<handled>
<constant>true</constant>
</handled>
<bean method="getExceptionResponse" ref="processorBean" />
</doCatch>
</doTry>
</route>
the activemq component, "activemqProducer" is defined like this:
<bean id="activemqProducer" class="org.apache.activemq.camel.component.ActiveMQComponent">
<property name="configuration" ref="jmsConfigProducer"/>
</bean>
<bean id="jmsConfigProducer" class="org.apache.camel.component.jms.JmsConfiguration" scope="prototype">
<property name="connectionFactory" ref="jmsFactoryProducer"/>
<property name="transacted" value="false"/>
<property name="deliveryPersistent" value="true"/>
<property name="timeToLive" value="5000"/>
</bean>
<bean id="jmsFactoryProducer" class="org.apache.activemq.pool.PooledConnectionFactory"
init-method="start" destroy-method="stop" scope="prototype">
<property name="connectionFactory" ref="jmsConnectionFactory" />
<property name="maxConnections" value="${jms.maximum.connection}" />
<property name="maximumActiveSessionPerConnection" value="${jms.maximum.active}" />
</bean>
<bean id ="jmsConnectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory">
<property name="brokerURL"><value>${message.broker}</value></property>
<property name="userName"><value>${message.broker.username}</value></property>
<property name="password"><value>${message.broker.password}</value></property>
<property name="optimizeAcknowledge" value="true"/>
<property name="useAsyncSend" value="true" />
</bean>
How can I include configurations for an individual dead letter queue for myQueue. If thats not possible, then how can I tell activemq to keep expired messages in myQueue