activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clebertsuco...@apache.org
Subject [17/50] [abbrv] activemq-artemis git commit: ARTEMIS-814: Support specifying connection properties
Date Mon, 07 Nov 2016 16:36:37 GMT
ARTEMIS-814: Support specifying connection properties


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

Branch: refs/heads/ARTEMIS-780
Commit: 00340c86e0f2654fcf3fea4b827f951035190062
Parents: 3ead28f
Author: Ulf Lilleengen <lulf@redhat.com>
Authored: Mon Nov 7 12:30:39 2016 +0100
Committer: Ulf Lilleengen <lulf@redhat.com>
Committed: Mon Nov 7 15:12:14 2016 +0100

----------------------------------------------------------------------
 .../protocol/amqp/client/AMQPClientConnectionFactory.java    | 8 ++++++--
 .../artemis/protocol/amqp/proton/AMQPConnectionContext.java  | 4 ++--
 .../artemis/protocol/amqp/proton/handler/ProtonHandler.java  | 4 +++-
 .../activemq/artemis/tests/integration/amqp/ProtonTest.java  | 3 ++-
 4 files changed, 13 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/00340c86/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/client/AMQPClientConnectionFactory.java
----------------------------------------------------------------------
diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/client/AMQPClientConnectionFactory.java
b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/client/AMQPClientConnectionFactory.java
index 5807809..b8851bb 100644
--- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/client/AMQPClientConnectionFactory.java
+++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/client/AMQPClientConnectionFactory.java
@@ -24,7 +24,9 @@ import org.apache.activemq.artemis.protocol.amqp.proton.AMQPConnectionContext;
 import org.apache.activemq.artemis.protocol.amqp.proton.AMQPConstants;
 import org.apache.activemq.artemis.protocol.amqp.proton.handler.EventHandler;
 import org.apache.activemq.artemis.spi.core.remoting.Connection;
+import org.apache.qpid.proton.amqp.Symbol;
 
+import java.util.Map;
 import java.util.Optional;
 import java.util.concurrent.Executor;
 
@@ -35,11 +37,13 @@ public class AMQPClientConnectionFactory {
 
    private final ActiveMQServer server;
    private final String containerId;
+   private final Map<Symbol, Object> connectionProperties;
    private final int ttl;
 
-   public AMQPClientConnectionFactory(ActiveMQServer server, String containerId, int ttl)
{
+   public AMQPClientConnectionFactory(ActiveMQServer server, String containerId, Map<Symbol,
Object> connectionProperties, int ttl) {
       this.server = server;
       this.containerId = containerId;
+      this.connectionProperties = connectionProperties;
       this.ttl = ttl;
    }
 
@@ -55,7 +59,7 @@ public class AMQPClientConnectionFactory {
 
       connectionCallback.setProtonConnectionDelegate(delegate);
 
-      amqpConnection.open();
+      amqpConnection.open(connectionProperties);
       return delegate;
    }
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/00340c86/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/AMQPConnectionContext.java
----------------------------------------------------------------------
diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/AMQPConnectionContext.java
b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/AMQPConnectionContext.java
index bdccd96..0f9e89e 100644
--- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/AMQPConnectionContext.java
+++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/AMQPConnectionContext.java
@@ -205,8 +205,8 @@ public class AMQPConnectionContext extends ProtonInitializable {
       return ExtCapability.getCapabilities();
    }
 
-   public void open() {
-      handler.open(containerId);
+   public void open(Map<Symbol, Object> connectionProperties) {
+      handler.open(containerId, connectionProperties);
    }
 
    public String getContainer() {

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/00340c86/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/handler/ProtonHandler.java
----------------------------------------------------------------------
diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/handler/ProtonHandler.java
b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/handler/ProtonHandler.java
index b4ddda0..945d01e 100644
--- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/handler/ProtonHandler.java
+++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/handler/ProtonHandler.java
@@ -30,6 +30,7 @@ import org.apache.activemq.artemis.protocol.amqp.sasl.SASLResult;
 import org.apache.activemq.artemis.protocol.amqp.sasl.ServerSASL;
 import org.apache.activemq.artemis.utils.ByteUtil;
 import org.apache.qpid.proton.Proton;
+import org.apache.qpid.proton.amqp.Symbol;
 import org.apache.qpid.proton.amqp.transport.ErrorCondition;
 import org.apache.qpid.proton.engine.Collector;
 import org.apache.qpid.proton.engine.Connection;
@@ -358,9 +359,10 @@ public class ProtonHandler extends ProtonInitializable {
 
    }
 
-   public void open(String containerId) {
+   public void open(String containerId, Map<Symbol, Object> connectionProperties) {
       this.transport.open();
       this.connection.setContainer(containerId);
+      this.connection.setProperties(connectionProperties);
       this.connection.open();
       flush();
    }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/00340c86/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/ProtonTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/ProtonTest.java
b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/ProtonTest.java
index e5d2f64..1a1021e 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/ProtonTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/ProtonTest.java
@@ -28,6 +28,7 @@ import java.net.URI;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
+import java.util.Collections;
 import java.util.Enumeration;
 import java.util.LinkedHashMap;
 import java.util.Map;
@@ -977,7 +978,7 @@ public class ProtonTest extends ProtonTestBase {
       final Map<String, Object> config = new LinkedHashMap<>();
       config.put(TransportConstants.HOST_PROP_NAME, "localhost");
       config.put(TransportConstants.PORT_PROP_NAME, "5673");
-      ProtonClientConnectionManager lifeCycleListener = new ProtonClientConnectionManager(new
AMQPClientConnectionFactory(server, server.getConfiguration().getName(), 5000), Optional.empty());
+      ProtonClientConnectionManager lifeCycleListener = new ProtonClientConnectionManager(new
AMQPClientConnectionFactory(server, "myid", Collections.singletonMap(Symbol.getSymbol("myprop"),
"propvalue"), 5000), Optional.empty());
       ProtonClientProtocolManager protocolManager = new ProtonClientProtocolManager(new ProtonProtocolManagerFactory(),
server);
       NettyConnector connector = new NettyConnector(config, lifeCycleListener, lifeCycleListener,
server.getExecutorFactory().getExecutor(), server.getExecutorFactory().getExecutor(), server.getScheduledPool(),
protocolManager);
       connector.start();


Mime
View raw message