activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cshan...@apache.org
Subject activemq git commit: https://issues.apache.org/jira/browse/AMQ-6418
Date Wed, 07 Sep 2016 12:28:46 GMT
Repository: activemq
Updated Branches:
  refs/heads/activemq-5.14.x c4bc626fe -> 4dbe61dd5


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

Fixing mqtt link stealing default setting for auto transport

(cherry picked from commit 88af1c70d96d2df15a127ba02d73f205202fb5cc)


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

Branch: refs/heads/activemq-5.14.x
Commit: 4dbe61dd562040ec73df309527f92a918d3779ed
Parents: c4bc626
Author: Christopher L. Shannon (cshannon) <christopher.l.shannon@gmail.com>
Authored: Wed Sep 7 08:17:34 2016 -0400
Committer: Christopher L. Shannon (cshannon) <christopher.l.shannon@gmail.com>
Committed: Wed Sep 7 08:28:36 2016 -0400

----------------------------------------------------------------------
 .../transport/auto/AutoSslTransportFactory.java   | 18 +++++++++++++++---
 .../transport/auto/AutoTcpTransportFactory.java   | 18 +++++++++++++++---
 2 files changed, 30 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/4dbe61dd/activemq-broker/src/main/java/org/apache/activemq/transport/auto/AutoSslTransportFactory.java
----------------------------------------------------------------------
diff --git a/activemq-broker/src/main/java/org/apache/activemq/transport/auto/AutoSslTransportFactory.java
b/activemq-broker/src/main/java/org/apache/activemq/transport/auto/AutoSslTransportFactory.java
index 824d321..19704e9 100644
--- a/activemq-broker/src/main/java/org/apache/activemq/transport/auto/AutoSslTransportFactory.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/transport/auto/AutoSslTransportFactory.java
@@ -32,6 +32,8 @@ import org.apache.activemq.broker.BrokerServiceAware;
 import org.apache.activemq.transport.TransportServer;
 import org.apache.activemq.transport.tcp.SslTransportFactory;
 import org.apache.activemq.transport.tcp.TcpTransport;
+import org.apache.activemq.transport.tcp.TcpTransportFactory;
+import org.apache.activemq.transport.tcp.TcpTransportServer;
 import org.apache.activemq.util.IOExceptionSupport;
 import org.apache.activemq.util.IntrospectionSupport;
 import org.apache.activemq.util.URISupport;
@@ -97,14 +99,24 @@ public class AutoSslTransportFactory extends SslTransportFactory implements
Brok
             @Override
             protected TcpTransport createTransport(Socket socket, WireFormat format)
                     throws IOException {
-                if (format.getClass().toString().contains("MQTT") && !allowLinkStealingSet)
{
-                    this.setAllowLinkStealing(true);
-                }
+                setDefaultLinkStealing(format, this);
                 return super.createTransport(socket, format);
             }
+
+            @Override
+            protected TcpTransport createTransport(Socket socket, WireFormat format,
+                    TcpTransportFactory detectedTransportFactory) throws IOException {
+                setDefaultLinkStealing(format, this);
+                return super.createTransport(socket, format, detectedTransportFactory);
+            }
         };
         return server;
     }
 
+    private void setDefaultLinkStealing(WireFormat format, TcpTransportServer server) {
+        if (format.getClass().toString().contains("MQTT") && !allowLinkStealingSet)
{
+            server.setAllowLinkStealing(true);
+        }
+    }
 
 }

http://git-wip-us.apache.org/repos/asf/activemq/blob/4dbe61dd/activemq-broker/src/main/java/org/apache/activemq/transport/auto/AutoTcpTransportFactory.java
----------------------------------------------------------------------
diff --git a/activemq-broker/src/main/java/org/apache/activemq/transport/auto/AutoTcpTransportFactory.java
b/activemq-broker/src/main/java/org/apache/activemq/transport/auto/AutoTcpTransportFactory.java
index 4f7d42a..8316422 100644
--- a/activemq-broker/src/main/java/org/apache/activemq/transport/auto/AutoTcpTransportFactory.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/transport/auto/AutoTcpTransportFactory.java
@@ -32,6 +32,7 @@ import org.apache.activemq.openwire.OpenWireFormatFactory;
 import org.apache.activemq.transport.TransportServer;
 import org.apache.activemq.transport.tcp.TcpTransport;
 import org.apache.activemq.transport.tcp.TcpTransportFactory;
+import org.apache.activemq.transport.tcp.TcpTransportServer;
 import org.apache.activemq.util.IOExceptionSupport;
 import org.apache.activemq.util.IntrospectionSupport;
 import org.apache.activemq.util.URISupport;
@@ -89,14 +90,25 @@ public class AutoTcpTransportFactory extends TcpTransportFactory implements
Brok
             @Override
             protected TcpTransport createTransport(Socket socket, WireFormat format)
                     throws IOException {
-                if (format.getClass().toString().contains("MQTT") && !allowLinkStealingSet)
{
-                    this.setAllowLinkStealing(true);
-                }
+                setDefaultLinkStealing(format, this);
                 return super.createTransport(socket, format);
             }
 
+            @Override
+            protected TcpTransport createTransport(Socket socket, WireFormat format,
+                    TcpTransportFactory detectedTransportFactory) throws IOException {
+                setDefaultLinkStealing(format, this);
+                return super.createTransport(socket, format, detectedTransportFactory);
+            }
+
         };
 
         return server;
     }
+
+    private void setDefaultLinkStealing(WireFormat format, TcpTransportServer server) {
+        if (format.getClass().toString().contains("MQTT") && !allowLinkStealingSet)
{
+            server.setAllowLinkStealing(true);
+        }
+    }
 }


Mime
View raw message