activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dej...@apache.org
Subject [3/3] activemq git commit: https://issues.apache.org/jira/browse/AMQ-5391: offer the ANONYMOUS-RELAY connection capability to signal support for the anonymous relay
Date Mon, 24 Nov 2014 15:10:44 GMT
https://issues.apache.org/jira/browse/AMQ-5391: offer the ANONYMOUS-RELAY connection capability
to
 signal support for the anonymous relay


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

Branch: refs/heads/trunk
Commit: 162f9fc5590b1403fb4e9b1fb23d249929d8bc62
Parents: 741b739
Author: Dejan Bosanac <dejan@nighttale.net>
Authored: Mon Nov 24 15:56:05 2014 +0100
Committer: Dejan Bosanac <dejan@nighttale.net>
Committed: Mon Nov 24 15:56:05 2014 +0100

----------------------------------------------------------------------
 .../activemq/transport/amqp/AmqpProtocolConverter.java  | 12 ++++++++++++
 1 file changed, 12 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/162f9fc5/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/AmqpProtocolConverter.java
----------------------------------------------------------------------
diff --git a/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/AmqpProtocolConverter.java
b/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/AmqpProtocolConverter.java
index 566ff71..80f7a40 100644
--- a/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/AmqpProtocolConverter.java
+++ b/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/AmqpProtocolConverter.java
@@ -119,6 +119,7 @@ class AmqpProtocolConverter implements IAmqpProtocolConverter {
     private static final Logger LOG = LoggerFactory.getLogger(AmqpProtocolConverter.class);
     private static final byte[] EMPTY_BYTE_ARRAY = new byte[] {};
     private static final int CHANNEL_MAX = 32767;
+    private static final Symbol ANONYMOUS_RELAY = Symbol.valueOf("ANONYMOUS-RELAY");
     private static final Symbol COPY = Symbol.getSymbol("copy");
     private static final Symbol JMS_SELECTOR = Symbol.valueOf("jms-selector");
     private static final Symbol NO_LOCAL = Symbol.valueOf("no-local");
@@ -152,10 +153,21 @@ class AmqpProtocolConverter implements IAmqpProtocolConverter {
         this.protonTransport.setChannelMax(CHANNEL_MAX);
 
         this.protonConnection.collect(eventCollector);
+        this.protonConnection.setOfferedCapabilities(getConnectionCapabilitiesOffered());
 
         updateTracer();
     }
 
+    /**
+     * Load and return a <code>[]Symbol</code> that contains the connection capabilities
+     * offered to new connections
+     *
+     * @return the capabilities that are offered to new clients on connect.
+     */
+    protected Symbol[] getConnectionCapabilitiesOffered() {
+        return new Symbol[]{ ANONYMOUS_RELAY };
+    }
+
     @Override
     public void updateTracer() {
         if (amqpTransport.isTrace()) {


Mime
View raw message