Mostly I have been using my route which is for a specific use case (jetty
consumer -> virtual topic -> http4producer). But I just created something
smaller which I've been testing with.

<bean id="exception" class="java.lang.Exception" />

<camelContext xmlns="http://camel.apache.org/schema/spring";>
  <route id="dlqtest">
      <from uri="activemq:queue:bar"/>
      <transacted ref="PROPAGATION_REQUIRES_NEW"/>
      <to uri="direct:throwexception"/>
      <onException>
        <exception>java.lang.Exception</exception>
        <rollback/>
      </onException>
    </route>

    <route id ="throwexception">
      <from uri="direct:throwexception"/>
      <throwException ref="exception"/>
    </route>
</camelContext>

I can't even get this setup to write to the ActiveMQ.DLQ. The karaf log
shows the message is rolledback and redelivered (I only have it set to
redeliver once for testing purposes). After resending once the message is
removed from queue:bar and goes nowhere. I have tried removing the
onException clause and many other configurations but nothing seems to be
working. My configuration for ActiveMQ is fairly standard based on the
documentation.

<bean id="jmsConnectionFactory"
class="org.apache.activemq.ActiveMQConnectionFactory">
  <property name="brokerURL">
    <value>tcp://localhost:61616</value> 
  </property>
  <property name="redeliveryPolicy" ref="standardRedeliveryPolicy"/>
</bean>

<bean id="jmsConfig"
class="org.apache.camel.component.jms.JmsConfiguration">
  <property name="connectionFactory" ref="jmsConnectionFactory"/>
  <property name="cacheLevelName" value="CACHE_CONSUMER" />
  <property name="concurrentConsumers" value="10"/>
  <property name="disableTimeToLive" value="true"/>
  <property name="deliveryPersistent" value="true"/>
  <property name="explicitQosEnabled" value="true"/>
  <property name="priority" value="1"/>
  <property name="transacted" value="true" />
  <property name="transactionManager" ref="jmsTransactionManager" />
</bean>

<bean id="activemq"
class="org.apache.activemq.camel.component.ActiveMQComponent">
  <property name="configuration" ref="jmsConfig"/>
</bean>

<bean id="pooledConnectionFactory"
class="org.apache.activemq.pool.PooledConnectionFactory" init-method="start"
destroy-method="stop">
  <property name="maxConnections" value="10" />
  <property name="maximumActive" value="500" />
  <property name="connectionFactory" ref="jmsConnectionFactory" />
</bean>

<bean id="standardRedeliveryPolicy"
class="org.apache.activemq.RedeliveryPolicy">
  <property name="maximumRedeliveries" value="1" />
  <property name="redeliveryDelay" value="1000" />
  <property name="useCollisionAvoidance" value="false"/>
  <property name="useExponentialBackOff" value="false"/>
</bean>

<bean id="jmsTransactionManager"
class="org.springframework.jms.connection.JmsTransactionManager">
  <property name="connectionFactory" ref="jmsConnectionFactory"/>
</bean>

<bean id="PROPAGATION_REQUIRES_NEW"
class="org.apache.camel.spring.spi.SpringTransactionPolicy">
  <property name="transactionManager" ref="jmsTransactionManager"/>
  <property name="propagationBehaviorName"
value="PROPAGATION_REQUIRES_NEW"/>
</bean>
<bean id="PROPAGATION_REQUIRED"
class="org.apache.camel.spring.spi.SpringTransactionPolicy">
  <property name="transactionManager" ref="jmsTransactionManager"/>
  <property name="propagationBehaviorName" value="PROPAGATION_REQUIRED"/>
</bean>

Thank again for the help.





--
View this message in context: 
http://activemq.2283324.n4.nabble.com/AMQ-DeadLetterStrategy-Not-Being-Respected-tp4670553p4670580.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Reply via email to