activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gtu...@apache.org
Subject svn commit: r1505000 - in /activemq/trunk: activemq-client/src/main/java/org/apache/activemq/ActiveMQMessageConsumer.java activemq-unit-tests/src/test/java/org/apache/activemq/MessageListenerRedeliveryTest.java
Date Fri, 19 Jul 2013 20:20:09 GMT
Author: gtully
Date: Fri Jul 19 20:20:08 2013
New Revision: 1505000

URL: http://svn.apache.org/r1505000
Log:
https://issues.apache.org/jira/browse/AMQ-4637 - track cause and policy

Modified:
    activemq/trunk/activemq-client/src/main/java/org/apache/activemq/ActiveMQMessageConsumer.java
    activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/MessageListenerRedeliveryTest.java

Modified: activemq/trunk/activemq-client/src/main/java/org/apache/activemq/ActiveMQMessageConsumer.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-client/src/main/java/org/apache/activemq/ActiveMQMessageConsumer.java?rev=1505000&r1=1504999&r2=1505000&view=diff
==============================================================================
--- activemq/trunk/activemq-client/src/main/java/org/apache/activemq/ActiveMQMessageConsumer.java
(original)
+++ activemq/trunk/activemq-client/src/main/java/org/apache/activemq/ActiveMQMessageConsumer.java
Fri Jul 19 20:20:08 2013
@@ -1207,7 +1207,8 @@ public class ActiveMQMessageConsumer imp
 
                     MessageAck ack = new MessageAck(lastMd, MessageAck.POSION_ACK_TYPE, deliveredMessages.size());
                     ack.setFirstMessageId(firstMsgId);
-                    ack.setPoisonCause(new Throwable("Exceeded redelivery policy limit:"
+ redeliveryPolicy));
+                    ack.setPoisonCause(new Throwable("Exceeded redelivery policy limit:"
+ redeliveryPolicy
+                            + ", cause:" + lastMd.getRollbackCause(), lastMd.getRollbackCause()));
                     session.sendAck(ack,true);
                     // Adjust the window size.
                     additionalWindowSize = Math.max(0, additionalWindowSize - deliveredMessages.size());

Modified: activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/MessageListenerRedeliveryTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/MessageListenerRedeliveryTest.java?rev=1505000&r1=1504999&r2=1505000&view=diff
==============================================================================
--- activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/MessageListenerRedeliveryTest.java
(original)
+++ activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/MessageListenerRedeliveryTest.java
Fri Jul 19 20:20:08 2013
@@ -327,8 +327,13 @@ public class MessageListenerRedeliveryTe
         message = dlqMessage[0];
         assertNotNull("dlq message captured", message);
         String cause = message.getStringProperty(ActiveMQMessage.DLQ_DELIVERY_FAILURE_CAUSE_PROPERTY);
+
         LOG.info("DLQ'd message cause reported as: {}", cause);
+
+        assertTrue("cause 'cause' exception is remembered", cause.contains("RuntimeException"));
+        assertTrue("is correct exception", cause.contains(getName()));
         assertTrue("cause exception is remembered", cause.contains("Throwable"));
+        assertTrue("cause policy is remembered", cause.contains("RedeliveryPolicy"));
 
         session.close();
     }



Mime
View raw message