From b76d8318d7b87f6d121d485a62ea63e7601d574e Mon Sep 17 00:00:00 2001 From: Hiram Chirino Date: Tue, 26 Aug 2014 17:04:25 -0400 Subject: [PATCH] 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. --- .../leveldb/replicated/ElectingLevelDBStore.scala | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) 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 9a1852e507..fe20530948 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 = {