mirror of https://github.com/apache/activemq.git
https://issues.apache.org/jira/browse/AMQ-4637 - track cause and policy
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1505000 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
17bf5c7d69
commit
20f384ce59
|
@ -1207,7 +1207,8 @@ public class ActiveMQMessageConsumer implements MessageAvailableConsumer, StatsC
|
|||
|
||||
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());
|
||||
|
|
|
@ -327,8 +327,13 @@ public class MessageListenerRedeliveryTest extends TestCase {
|
|||
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();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue