activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clebertsuco...@apache.org
Subject [2/2] activemq-artemis git commit: ARTEMIS-1329 testNoLocalReconnect was failing with OpenWire protocol
Date Tue, 19 Dec 2017 03:24:53 GMT
ARTEMIS-1329 testNoLocalReconnect was failing with OpenWire protocol


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

Branch: refs/heads/master
Commit: 04f74425c9b4938baf0e230e03884683311a417a
Parents: fe537fa
Author: Stanislav Knot <sknot@redhat.com>
Authored: Mon Dec 18 12:28:30 2017 +0100
Committer: Clebert Suconic <clebertsuconic@apache.org>
Committed: Mon Dec 18 22:24:43 2017 -0500

----------------------------------------------------------------------
 .../artemis/core/protocol/openwire/amq/AMQConsumer.java     | 2 +-
 .../tests/integration/jms/client/NoLocalSubscriberTest.java | 9 +++++++--
 2 files changed, 8 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/04f74425/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/amq/AMQConsumer.java
----------------------------------------------------------------------
diff --git a/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/amq/AMQConsumer.java
b/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/amq/AMQConsumer.java
index fb50582..c98b9d2 100644
--- a/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/amq/AMQConsumer.java
+++ b/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/amq/AMQConsumer.java
@@ -95,7 +95,7 @@ public class AMQConsumer {
          } else {
             preAck = true;
          }
-         String noLocalSelector = MessageUtil.CONNECTION_ID_PROPERTY_NAME.toString() + "<>'"
+ this.getId().getConnectionId() + "'";
+         String noLocalSelector = MessageUtil.CONNECTION_ID_PROPERTY_NAME.toString() + "<>'"
+ info.getClientId() + "'";
          if (selector == null) {
             selector = new SimpleString(noLocalSelector);
          } else {

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/04f74425/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/NoLocalSubscriberTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/NoLocalSubscriberTest.java
b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/NoLocalSubscriberTest.java
index 860b9ad..64d0775 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/NoLocalSubscriberTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/NoLocalSubscriberTest.java
@@ -26,6 +26,7 @@ import javax.jms.TextMessage;
 import javax.jms.Topic;
 import javax.jms.TopicSubscriber;
 
+import org.apache.activemq.artemis.reader.MessageUtil;
 import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger;
 import org.apache.activemq.artemis.tests.util.JMSTestBase;
 import org.apache.activemq.artemis.utils.RandomUtil;
@@ -145,7 +146,9 @@ public class NoLocalSubscriberTest extends JMSTestBase {
          connection.setClientID(clientID);
          Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
          MessageProducer messageProducer = session.createProducer(topic);
-         messageProducer.send(session.createTextMessage("M3"));
+         TextMessage textMessage = session.createTextMessage("M3");
+         textMessage.setStringProperty(MessageUtil.CONNECTION_ID_PROPERTY_NAME.toString(),
clientID);
+         messageProducer.send(textMessage);
          connection.close();
       }
 
@@ -157,7 +160,9 @@ public class NoLocalSubscriberTest extends JMSTestBase {
          connection.setClientID(clientID + "_different");
          Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
          MessageProducer messageProducer = session.createProducer(topic);
-         messageProducer.send(session.createTextMessage("M4"));
+         TextMessage textMessage = session.createTextMessage("M4");
+         textMessage.setStringProperty(MessageUtil.CONNECTION_ID_PROPERTY_NAME.toString(),
clientID + "_different");
+         messageProducer.send(textMessage);
          connection.close();
       }
 


Mime
View raw message