You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ch...@apache.org on 2014/08/27 19:08:20 UTC

git commit: Support configuring a connectUrl on the leveldb store in case your running in a system like OpenShift where clients connect to a different ip:port from the one that the sever binds.

Repository: activemq
Updated Branches:
  refs/heads/trunk b9696ac80 -> b76d8318d


Support configuring a connectUrl on the leveldb store in case your running in a system like OpenShift where clients connect to a different ip:port from the one that the sever binds.


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

Branch: refs/heads/trunk
Commit: b76d8318d7b87f6d121d485a62ea63e7601d574e
Parents: b9696ac
Author: Hiram Chirino <hi...@hiramchirino.com>
Authored: Tue Aug 26 17:04:25 2014 -0400
Committer: Hiram Chirino <hi...@hiramchirino.com>
Committed: Wed Aug 27 13:08:01 2014 -0400

----------------------------------------------------------------------
 .../leveldb/replicated/ElectingLevelDBStore.scala     | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/b76d8318/activemq-leveldb-store/src/main/scala/org/apache/activemq/leveldb/replicated/ElectingLevelDBStore.scala
----------------------------------------------------------------------
diff --git a/activemq-leveldb-store/src/main/scala/org/apache/activemq/leveldb/replicated/ElectingLevelDBStore.scala b/activemq-leveldb-store/src/main/scala/org/apache/activemq/leveldb/replicated/ElectingLevelDBStore.scala
index 9a1852e..fe20530 100644
--- a/activemq-leveldb-store/src/main/scala/org/apache/activemq/leveldb/replicated/ElectingLevelDBStore.scala
+++ b/activemq-leveldb-store/src/main/scala/org/apache/activemq/leveldb/replicated/ElectingLevelDBStore.scala
@@ -78,6 +78,10 @@ class ElectingLevelDBStore extends ProxyLevelDBStore {
 
   @BeanProperty
   var hostname: String = _
+
+  @BeanProperty
+  var connectUrl: String = _
+
   @BeanProperty
   var bind = "tcp://0.0.0.0:61619"
 
@@ -371,10 +375,14 @@ class ElectingLevelDBStore extends ProxyLevelDBStore {
   }
 
   def address(port: Int) = {
-    if (hostname == null) {
-      hostname = machine_hostname
+    if( connectUrl==null ) {
+      if (hostname == null) {
+        hostname = machine_hostname
+      }
+      "tcp://" + hostname + ":" + port
+    } else {
+      connectUrl;
     }
-    "tcp://" + hostname + ":" + port
   }
 
   override def size: Long = {