|
1 | | -/* Bootstrap configures Hazelcast for clustering in Docker |
| 1 | +/* |
| 2 | + Bootstrap configures Hazelcast for clustering in Docker |
2 | 3 | It performs two tasks: |
| 4 | +
|
3 | 5 | 1) Setup Hazelcast for routing between Docker instances on different hosts |
4 | 6 | 2) Setup the Vertx event bus for routing between verticles running in these Docker instances |
| 7 | +
|
| 8 | + This code is based almost entirely on the standard Vertx Starter class and the extra commit remarks regarding |
| 9 | + the programmatic configuration of the event bus, please see: |
| 10 | +
|
| 11 | + https://github.com/eclipse/vert.x/blob/master/vertx-platform/src/main/java/org/vertx/java/platform/impl/cli/Starter.java |
| 12 | + https://github.com/eclipse/vert.x/pull/777 |
5 | 13 | */ |
| 14 | + |
| 15 | +package io.magnetic.vamp; |
| 16 | + |
6 | 17 | import org.vertx.java.core.json.JsonObject; |
7 | 18 | import org.vertx.java.core.logging.Logger; |
8 | 19 | import org.vertx.java.core.logging.impl.LoggerFactory; |
@@ -101,13 +112,13 @@ private void runVertx(Args args) { |
101 | 112 | JsonObject conf = new JsonObject(); |
102 | 113 |
|
103 | 114 | // Set the initializing verticle. This is the verticle that will spin up all other verticles |
104 | | - URL file_location = null; |
| 115 | + URL classpath_location = null; |
105 | 116 | try { |
106 | | - file_location = new URL("file:///" + vertxClassPath); |
| 117 | + classpath_location = new URL("file:///" + vertxClassPath); |
107 | 118 | } catch (MalformedURLException e) { |
108 | 119 | e.printStackTrace(); |
109 | 120 | } |
110 | | - URL[] classpath = new URL[]{file_location}; |
| 121 | + URL[] classpath = new URL[]{classpath_location}; |
111 | 122 |
|
112 | 123 | pm.deployVerticle(vertxVerticle, conf, classpath, 1, null, new AsyncResultHandler<String>() { |
113 | 124 | public void handle(AsyncResult<String> asyncResult) { |
|
0 commit comments