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-1892 allow whitespace in acceptor and connector URIs
Date Mon, 04 Jun 2018 14:34:31 GMT
Repository: activemq-artemis
Updated Branches:
  refs/heads/master 81935cfa0 -> a79798532


ARTEMIS-1892 allow whitespace in acceptor and connector URIs


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

Branch: refs/heads/master
Commit: 9183172de348b1e376b46329da8bdcada8ff1bfc
Parents: 81935cf
Author: Justin Bertram <jbertram@apache.org>
Authored: Fri Jun 1 12:26:12 2018 -0500
Committer: Clebert Suconic <clebertsuconic@apache.org>
Committed: Mon Jun 4 10:07:19 2018 -0400

----------------------------------------------------------------------
 .../artemis/core/config/ConfigurationUtils.java        |  7 ++++++-
 .../test/resources/ConfigurationTest-full-config.xml   | 13 +++++++++++--
 2 files changed, 17 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/9183172d/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/ConfigurationUtils.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/ConfigurationUtils.java
b/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/ConfigurationUtils.java
index 1076611..6d4661b 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/ConfigurationUtils.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/ConfigurationUtils.java
@@ -141,6 +141,9 @@ public final class ConfigurationUtils {
 
    public static List<TransportConfiguration> parseAcceptorURI(String name, String
uri) {
       try {
+         // remove all whitespace
+         uri = uri.replaceAll("\\s", "");
+
          AcceptorTransportConfigurationParser parser = new AcceptorTransportConfigurationParser();
 
          List<TransportConfiguration> configurations = parser.newObject(parser.expandURI(uri),
name);
@@ -165,8 +168,10 @@ public final class ConfigurationUtils {
    }
 
    public static List<TransportConfiguration> parseConnectorURI(String name, String
uri) {
-
       try {
+         // remove all whitespace
+         uri = uri.replaceAll("\\s", "");
+
          ConnectorTransportConfigurationParser parser = new ConnectorTransportConfigurationParser();
 
          List<TransportConfiguration> configurations = parser.newObject(parser.expandURI(uri),
name);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/9183172d/artemis-server/src/test/resources/ConfigurationTest-full-config.xml
----------------------------------------------------------------------
diff --git a/artemis-server/src/test/resources/ConfigurationTest-full-config.xml b/artemis-server/src/test/resources/ConfigurationTest-full-config.xml
index 491b0c2..eb561fc 100644
--- a/artemis-server/src/test/resources/ConfigurationTest-full-config.xml
+++ b/artemis-server/src/test/resources/ConfigurationTest-full-config.xml
@@ -71,11 +71,20 @@
       </remoting-outgoing-interceptors>
       <persist-delivery-count-before-delivery>true</persist-delivery-count-before-delivery>
       <connectors>
-         <connector name="connector1">tcp://localhost1:5678?localAddress=mylocal;localPort=99</connector>
+         <connector name="connector1">
+            tcp://localhost1:5678?
+            localAddress=mylocal;
+            localPort=99
+         </connector>
          <connector name="connector2">vm://5</connector>
       </connectors>
       <acceptors>
-         <acceptor>tcp://0.0.0.0:61616?tcpNoDelay=456;connectionTtl=44;connectionsAllowed=92</acceptor>
+         <acceptor>
+            tcp://0.0.0.0:61616?
+            tcpNoDelay=456;
+            connectionTtl=44;
+            connectionsAllowed=92
+         </acceptor>
          <acceptor>vm://0?e1=z1;e2=567;connectionsAllowed=87</acceptor>
       </acceptors>
       <broadcast-groups>


Mime
View raw message