activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject [1/2] activemq git commit: AMQ-6808 preserve destination for browsed scheduled messages
Date Fri, 15 Sep 2017 13:03:06 GMT
Repository: activemq
Updated Branches:
  refs/heads/master a359d8152 -> 31f507001


AMQ-6808 preserve destination for browsed scheduled messages


Project: http://git-wip-us.apache.org/repos/asf/activemq/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq/commit/c691124d
Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/c691124d
Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/c691124d

Branch: refs/heads/master
Commit: c691124d3288ffc9299bedca69b952952f2cbcf6
Parents: a359d81
Author: Erik Wramner <erik.wramner@codemint.com>
Authored: Tue Sep 12 21:46:02 2017 +0200
Committer: Timothy Bish <tabish121@gmail.com>
Committed: Fri Sep 15 09:02:36 2017 -0400

----------------------------------------------------------------------
 .../org/apache/activemq/broker/scheduler/SchedulerBroker.java    | 4 ++++
 .../activemq/broker/scheduler/JobSchedulerManagementTest.java    | 4 ++++
 2 files changed, 8 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/c691124d/activemq-broker/src/main/java/org/apache/activemq/broker/scheduler/SchedulerBroker.java
----------------------------------------------------------------------
diff --git a/activemq-broker/src/main/java/org/apache/activemq/broker/scheduler/SchedulerBroker.java
b/activemq-broker/src/main/java/org/apache/activemq/broker/scheduler/SchedulerBroker.java
index a00b456..5542973 100644
--- a/activemq-broker/src/main/java/org/apache/activemq/broker/scheduler/SchedulerBroker.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/broker/scheduler/SchedulerBroker.java
@@ -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);

http://git-wip-us.apache.org/repos/asf/activemq/blob/c691124d/activemq-unit-tests/src/test/java/org/apache/activemq/broker/scheduler/JobSchedulerManagementTest.java
----------------------------------------------------------------------
diff --git a/activemq-unit-tests/src/test/java/org/apache/activemq/broker/scheduler/JobSchedulerManagementTest.java
b/activemq-unit-tests/src/test/java/org/apache/activemq/broker/scheduler/JobSchedulerManagementTest.java
index c944be3..6f6dc76 100644
--- a/activemq-unit-tests/src/test/java/org/apache/activemq/broker/scheduler/JobSchedulerManagementTest.java
+++ b/activemq-unit-tests/src/test/java/org/apache/activemq/broker/scheduler/JobSchedulerManagementTest.java
@@ -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);


Mime
View raw message