activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject activemq git commit: https://issues.apache.org/jira/browse/AMQ-6304
Date Wed, 01 Jun 2016 22:38:48 GMT
Repository: activemq
Updated Branches:
  refs/heads/master 8448cf1cb -> 76b70545f


https://issues.apache.org/jira/browse/AMQ-6304

Ensure that the broker send a container ID using its assigned Broker
name value.

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

Branch: refs/heads/master
Commit: 76b70545f248e6970245719f2f584298b8d493fd
Parents: 8448cf1
Author: Timothy Bish <tabish121@gmail.com>
Authored: Wed Jun 1 18:38:41 2016 -0400
Committer: Timothy Bish <tabish121@gmail.com>
Committed: Wed Jun 1 18:38:41 2016 -0400

----------------------------------------------------------------------
 .../transport/amqp/protocol/AmqpConnection.java |  1 +
 .../amqp/interop/AmqpConnectionsTest.java       | 29 ++++++++++++++++++++
 2 files changed, 30 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/76b70545/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/protocol/AmqpConnection.java
----------------------------------------------------------------------
diff --git a/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/protocol/AmqpConnection.java
b/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/protocol/AmqpConnection.java
index 25ca37c..a0927ad 100644
--- a/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/protocol/AmqpConnection.java
+++ b/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/protocol/AmqpConnection.java
@@ -492,6 +492,7 @@ public class AmqpConnection implements AmqpProtocolConverter {
 
                         protonConnection.setOfferedCapabilities(getConnectionCapabilitiesOffered());
                         protonConnection.setProperties(getConnetionProperties());
+                        protonConnection.setContainer(brokerService.getBrokerName());
                         protonConnection.open();
 
                         configureInactivityMonitor();

http://git-wip-us.apache.org/repos/asf/activemq/blob/76b70545/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/interop/AmqpConnectionsTest.java
----------------------------------------------------------------------
diff --git a/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/interop/AmqpConnectionsTest.java
b/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/interop/AmqpConnectionsTest.java
index 27d7e2e..971b1df 100644
--- a/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/interop/AmqpConnectionsTest.java
+++ b/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/interop/AmqpConnectionsTest.java
@@ -114,6 +114,35 @@ public class AmqpConnectionsTest extends AmqpClientTestSupport {
     }
 
     @Test(timeout = 60000)
+    public void testConnectionCarriesContainerId() throws Exception {
+        AmqpClient client = createAmqpClient();
+        assertNotNull(client);
+
+        client.setValidator(new AmqpValidator() {
+
+            @Override
+            public void inspectOpenedResource(Connection connection) {
+                String remoteContainer = connection.getRemoteContainer();
+                if (remoteContainer == null || !remoteContainer.equals(brokerService.getBrokerName()))
{
+                    markAsInvalid("Broker did not send a valid container ID");
+                } else {
+                    LOG.info("Broker container ID = {}", remoteContainer);
+                }
+            }
+        });
+
+        AmqpConnection connection = client.connect();
+        assertNotNull(connection);
+
+        assertEquals(1, getProxyToBroker().getCurrentConnectionsCount());
+
+        connection.getStateInspector().assertValid();
+        connection.close();
+
+        assertEquals(0, getProxyToBroker().getCurrentConnectionsCount());
+    }
+
+    @Test(timeout = 60000)
     public void testCanConnectWithDifferentContainerIds() throws Exception {
         AmqpClient client = createAmqpClient();
         assertNotNull(client);


Mime
View raw message