public boolean moveMessage(final String messageID, final String otherQueueName, final boolean rejectDuplicates) throws Exception { String filter = JMSQueueControlImpl.createFilterForJMSMessageID(messageID); HornetQDestination otherQueue = HornetQDestination.createQueue(otherQueueName); int moved = coreQueueControl.moveMessages(filter, otherQueue.getAddress(), rejectDuplicates); if (moved != 1) { throw new IllegalArgumentException("No message found for JMSMessageID: " + messageID); } return true; }
public int moveMessages(final String filterStr, final String otherQueueName, final boolean rejectDuplicates) throws Exception { String filter = JMSQueueControlImpl.createFilterFromJMSSelector(filterStr); HornetQDestination otherQueue = HornetQDestination.createQueue(otherQueueName); return coreQueueControl.moveMessages(filter, otherQueue.getAddress(), rejectDuplicates); }