// send 2 messages on queue
JMSUtil.sendMessageWithProperty(sess, queue, key, matchingValue);
JMSUtil.sendMessageWithProperty(sess, queue, key, unmatchingValue);
JMSQueueControl queueControl = createManagementControl();
JMSQueueControl dlqControl = ManagementControlHelper.createJMSQueueControl(dlq, mbeanServer);
Assert.assertEquals(2, queueControl.getMessageCount());
Assert.assertEquals(0, dlqControl.getMessageCount());
queueControl.setDeadLetterAddress(dlq.getAddress());
int deadMessageCount = queueControl.sendMessagesToDeadLetterAddress(filter);
Assert.assertEquals(1, deadMessageCount);
Assert.assertEquals(1, queueControl.getMessageCount());
Assert.assertEquals(1, dlqControl.getMessageCount());
conn.start();
MessageConsumer consumer = sess.createConsumer(queue);
Message message = consumer.receive(500);