activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbert...@apache.org
Subject [1/2] activemq-artemis git commit: ARTEMIS-1008 - Allow web server host to be set on create
Date Wed, 01 Mar 2017 14:29:41 GMT
Repository: activemq-artemis
Updated Branches:
  refs/heads/master 70721dcd5 -> 3a9e7ec47


ARTEMIS-1008 - Allow web server host to be set on create

https://issues.apache.org/jira/browse/ARTEMIS-1008


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

Branch: refs/heads/master
Commit: 2b369f9ef96adc19c31aa7cc2c6e6376c515b43f
Parents: 70721dc
Author: Andy Taylor <andy.tayls67@gmail.com>
Authored: Wed Mar 1 10:19:49 2017 +0000
Committer: Andy Taylor <andy.tayls67@gmail.com>
Committed: Wed Mar 1 10:19:49 2017 +0000

----------------------------------------------------------------------
 .../java/org/apache/activemq/artemis/cli/commands/Create.java  | 6 ++++++
 .../artemis/cli/commands/etc/bootstrap-web-settings.txt        | 2 +-
 .../test/java/org/apache/activemq/cli/test/ArtemisTest.java    | 2 +-
 3 files changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/2b369f9e/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Create.java
----------------------------------------------------------------------
diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Create.java
b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Create.java
index cd42f80..5dae3c9 100644
--- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Create.java
+++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/Create.java
@@ -60,6 +60,8 @@ public class Create extends InputAbstract {
 
    private static final Integer HQ_PORT = 5445;
 
+   public static final String HTTP_HOST = "localhost";
+
    public static final Integer HTTP_PORT = 8161;
 
    private static final Integer MQTT_PORT = 1883;
@@ -105,6 +107,9 @@ public class Create extends InputAbstract {
    @Option(name = "--host", description = "The host name of the broker (Default: 0.0.0.0
or input if clustered)")
    String host;
 
+   @Option(name = "--http-host", description = "The host name to use for embedded web server
(Default: localhost)")
+   String httpHost = HTTP_HOST;
+
    @Option(name = "--ping", description = "A comma separated string to be passed on to the
broker config as network-check-list. The broker will shutdown when all these addresses are
unreachable.")
    String ping;
 
@@ -631,6 +636,7 @@ public class Create extends InputAbstract {
       filters.put("${stomp.port}", String.valueOf(STOMP_PORT + portOffset));
       filters.put("${hq.port}", String.valueOf(HQ_PORT + portOffset));
       filters.put("${mqtt.port}", String.valueOf(MQTT_PORT + portOffset));
+      filters.put("${http.host}", httpHost);
       filters.put("${http.port}", String.valueOf(httpPort + portOffset));
       filters.put("${data.dir}", data);
       filters.put("${max-hops}", String.valueOf(maxHops));

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/2b369f9e/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/bootstrap-web-settings.txt
----------------------------------------------------------------------
diff --git a/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/bootstrap-web-settings.txt
b/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/bootstrap-web-settings.txt
index 946b485..c4d83c8 100644
--- a/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/bootstrap-web-settings.txt
+++ b/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/bootstrap-web-settings.txt
@@ -1,4 +1,4 @@
    <!-- The web server is only bound to loalhost by default -->
-   <web bind="${web.protocol}://localhost:${http.port}" path="web"${extra.web.attributes}>
+   <web bind="${web.protocol}://${http.host}:${http.port}" path="web"${extra.web.attributes}>
        <app url="jolokia" war="jolokia-war-1.3.5.war"/>
    </web>

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/2b369f9e/artemis-cli/src/test/java/org/apache/activemq/cli/test/ArtemisTest.java
----------------------------------------------------------------------
diff --git a/artemis-cli/src/test/java/org/apache/activemq/cli/test/ArtemisTest.java b/artemis-cli/src/test/java/org/apache/activemq/cli/test/ArtemisTest.java
index 72e2ca3..803020c 100644
--- a/artemis-cli/src/test/java/org/apache/activemq/cli/test/ArtemisTest.java
+++ b/artemis-cli/src/test/java/org/apache/activemq/cli/test/ArtemisTest.java
@@ -157,7 +157,7 @@ public class ArtemisTest extends CliTestBase {
       Element webElem = (Element) config.getElementsByTagName("web").item(0);
 
       String bindAttr = webElem.getAttribute("bind");
-      String bindStr = "http://localhost:" + Create.HTTP_PORT;
+      String bindStr = "http://" + Create.HTTP_HOST + ":" + Create.HTTP_PORT;
 
       assertEquals(bindAttr, bindStr);
       //no any of those


Mime
View raw message