mirror of https://github.com/apache/activemq.git
AMQ-6808 preserve destination for browsed scheduled messages
This commit is contained in:
parent
a359d8152c
commit
c691124d32
|
@ -426,6 +426,10 @@ public class SchedulerBroker extends BrokerFilter implements JobListener {
|
|||
msg.setPersistent(false);
|
||||
msg.setType(AdvisorySupport.ADIVSORY_MESSAGE_TYPE);
|
||||
msg.setMessageId(new MessageId(this.producerId, this.messageIdGenerator.getNextSequenceId()));
|
||||
|
||||
// Preserve original destination
|
||||
msg.setOriginalDestination(msg.getDestination());
|
||||
|
||||
msg.setDestination(replyTo);
|
||||
msg.setResponseRequired(false);
|
||||
msg.setProducerId(this.producerId);
|
||||
|
|
|
@ -34,6 +34,7 @@ import javax.jms.Session;
|
|||
import javax.jms.TextMessage;
|
||||
|
||||
import org.apache.activemq.ScheduledMessage;
|
||||
import org.apache.activemq.command.ActiveMQMessage;
|
||||
import org.apache.activemq.util.IdGenerator;
|
||||
import org.junit.Test;
|
||||
import org.slf4j.Logger;
|
||||
|
@ -396,6 +397,9 @@ public class JobSchedulerManagementTest extends JobSchedulerTestSupport {
|
|||
assertNotNull(message);
|
||||
assertEquals(45000, message.getLongProperty(ScheduledMessage.AMQ_SCHEDULED_DELAY));
|
||||
|
||||
// Verify that original destination was preserved
|
||||
assertEquals(destination, ((ActiveMQMessage) message).getOriginalDestination());
|
||||
|
||||
// Now check if there are anymore, there shouldn't be
|
||||
message = browser.receive(5000);
|
||||
assertNull(message);
|
||||
|
|
Loading…
Reference in New Issue