activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clebertsuco...@apache.org
Subject [1/2] activemq-artemis git commit: [ARTEMIS-1043] Support IPv6 in NettyConnector
Date Wed, 03 May 2017 16:31:59 GMT
Repository: activemq-artemis
Updated Branches:
  refs/heads/1.x a03db5baf -> 6f0babb36


[ARTEMIS-1043] Support IPv6 in NettyConnector

Wrap the host added to the HTTP request headers with
IPV6Util.encloseHost to ensure that load balancers that reads the header
will have a valid IPv6 address.

JIRA: https://issues.apache.org/jira/browse/ARTEMIS-1043


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

Branch: refs/heads/1.x
Commit: 64c89b6874a0c72df15397db779ecb817885be35
Parents: a03db5b
Author: Jeff Mesnil <jmesnil@gmail.com>
Authored: Wed May 3 09:56:24 2017 +0200
Committer: Jeff Mesnil <jmesnil@gmail.com>
Committed: Wed May 3 09:56:24 2017 +0200

----------------------------------------------------------------------
 .../artemis/core/remoting/impl/netty/NettyConnector.java        | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/64c89b68/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/NettyConnector.java
----------------------------------------------------------------------
diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/NettyConnector.java
b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/NettyConnector.java
index e1c7bd6..0b0d840 100644
--- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/NettyConnector.java
+++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/remoting/impl/netty/NettyConnector.java
@@ -659,9 +659,10 @@ public class NettyConnector extends AbstractConnector {
                if (sslEnabled) {
                   scheme = "https";
                }
-               URI uri = new URI(scheme, null, IPV6Util.encloseHost(host), port, null, null,
null);
+               String ipv6Host = IPV6Util.encloseHost(host);
+               URI uri = new URI(scheme, null, ipv6Host, port, null, null, null);
                HttpRequest request = new DefaultHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.GET,
uri.getRawPath());
-               request.headers().set(HttpHeaders.Names.HOST, host);
+               request.headers().set(HttpHeaders.Names.HOST, ipv6Host);
                request.headers().set(HttpHeaders.Names.UPGRADE, ACTIVEMQ_REMOTING);
                request.headers().set(HttpHeaders.Names.CONNECTION, HttpHeaders.Values.UPGRADE);
                final String serverName = ConfigurationHelper.getStringProperty(TransportConstants.ACTIVEMQ_SERVER_NAME,
null, configuration);


Mime
View raw message