Hello,

I'm facing problem with DLQ on topic: my test retrieves a message from a
topic, throws an exeption. The message is rolled back two times (while the
maximum is 3,
tcp://localhost:61616?jms.redeliveryPolicy.maximumRedeliveries=3). So, the
message could be received one more time. The message is not placed in DLQ
(may be because it has not been rolled back 3 times).  I've tried on
activeMQ 5.3.2 and 5.2.0. Unfortunately both of them seam to act in the same
way.


Note that an exception is thrown: 

javax.jms.JMSException: Invalid acknowledgment: MessageAck {commandId = 240,
responseRequired = false, ackType = 3, consumerId =
ID:lln195-4044-1274973005063-0:152:10:1, firstMessageId =
ID:lln195-4044-1274973005063-0:152:17:1:1, lastMessageId =
ID:lln195-4044-1274973005063-0:152:17:1:1, destination =
topic://topic/topicA, transactionId = null, messageCount = 1}
        at
org.apache.activemq.broker.region.TopicSubscription.acknowledge(TopicSubscription.java:244)
        at
org.apache.activemq.broker.region.AbstractRegion.acknowledge(AbstractRegion.java:373)
        at
org.apache.activemq.broker.region.RegionBroker.acknowledge(RegionBroker.java:470)
        at
org.apache.activemq.broker.TransactionBroker.acknowledge(TransactionBroker.java:194)
        at
org.apache.activemq.broker.BrokerFilter.acknowledge(BrokerFilter.java:74)
        at
org.apache.activemq.broker.BrokerFilter.acknowledge(BrokerFilter.java:74)
        at
org.apache.activemq.broker.MutableBrokerFilter.acknowledge(MutableBrokerFilter.java:85)
        at
org.apache.activemq.broker.TransportConnection.processMessageAck(TransportConnection.java:452)
        at org.apache.activemq.command.MessageAck.visit(MessageAck.java:205)
        at
org.apache.activemq.broker.TransportConnection.service(TransportConnection.java:300)
        at
org.apache.activemq.broker.TransportConnection$1.onCommand(TransportConnection.java:178)
        at
org.apache.activemq.transport.TransportFilter.onCommand(TransportFilter.java:68)
        at
org.apache.activemq.transport.WireFormatNegotiator.onCommand(WireFormatNegotiator.java:113)
        at
org.apache.activemq.transport.InactivityMonitor.onCommand(InactivityMonitor.java:216)
        at
org.apache.activemq.transport.TransportSupport.doConsume(TransportSupport.java:84)
        at
org.apache.activemq.transport.tcp.TcpTransport.doRun(TcpTransport.java:204)
        at
org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:186)
        at java.lang.Thread.run(Thread.java:595)


I've simply added the following lines to the default configuration:

                    <policyEntry queue=">">
                        <deadLetterStrategy>
                            <individualDeadLetterStrategy queuePrefix="DLQ."
/>
                        </deadLetterStrategy>
                    </policyEntry>
                    <policyEntry topic=">">
                        <deadLetterStrategy>
                            <individualDeadLetterStrategy queuePrefix="DLQ."
useQueueForTopicMessages="true"/>
                        </deadLetterStrategy>
                    </policyEntry>


My configuration is based on Spring:

    <bean id="connectionFactory"
         
class="org.springframework.jms.connection.CachingConnectionFactory">
        <property name="sessionCacheSize" value="5"/>
        <property name="targetConnectionFactory">
            <bean
class="org.apache.activemq.spring.ActiveMQConnectionFactory">
                <property name="properties" ref="brokerConfiguration" />
            </bean>
        </property>
    </bean>

    <bean id="abstractJmsTopicListener" abstract="true"
         
class="org.springframework.jms.listener.DefaultMessageListenerContainer">
        <property name="concurrentConsumers" value="1"/>
        <property name="sessionTransacted" value="true"/>
        <property name="pubSubDomain" value="true"/>
    </bean>


Thank you very much :)
-- 
View this message in context: 
http://old.nabble.com/Topic---DLQ-tp28694454p28694454.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Reply via email to