This closes #259

This commit is contained in:
Timothy Bish 2017-09-15 09:02:48 -04:00
commit 31f507001a
2 changed files with 8 additions and 0 deletions

View File

@ -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);

View File

@ -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);