Hello again Joakim!
To complement Håkans answer please look into the generated integration test for the jms-to-jms one way case!
There you will find notes such as:
/**
*
* DLQ tests expects the following setup in activemq.xml (in the <policyEntry> - element):
* <deadLetterStrategy>
* <!--
* Use the prefix 'DLQ.' for the destination name, and make
* the DLQ a queue rather than a topic
* -->
* <individualDeadLetterStrategy queuePrefix="DLQ." useQueueForQueueMessages="true" />
* </deadLetterStrategy>
*
*/
public JmsToJmsIntegrationTest() {
...and tests that verify that the DLQ is receiving poisoned messages as expected:
@Test
public void testJmsToJms_transformationError() throws JMSException {
// Verify that the message now is gone from the in-queue
assertEquals("Sent message not removed", 0, jmsUtil.browseMessagesOnQueue(IN_QUEUE).size());
// Verify that the in-message now is found on the deadletter queue
List<Message> msgs = jmsUtil.browseMessagesOnQueue(DEADLETTER_QUEUE);
assertEquals("Incorrect number of DLQ-messages", 1, msgs.size());
String dlqMsg = ((TextMessage)msgs.get(0)).getText();
assertEquals("Message on DLQ is not identical with the message sent", dlqMsg, message);
// Verifying that we now have four identical log-messages on the error-log-queue
// One message for the initial attempt and three more for the redeliveries
assertErrorLogMessages(4, expectedErrMsg);
// Verify as well that nothing is placed on the out-queue
assertEquals("Unexpected message on out-queue", 0, jmsUtil.browseMessagesOnQueue(OUT_QUEUE).size());
If these tests runs ok it indicates to me that we have the expected behaviour when running the integration test (using an embedded activemq broker)
If you runt the flow in a mule-server and have configured AMQ as defined above you should be able to see the same behaviour if you place a (persist) poisoned message in the in-queue!
Try it out and let us know if it still doesn't seem to work!
Regards,
Magnus.