You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Korny Sietsma <ko...@sietsma.com> on 2016/07/22 12:00:19 UTC

Overriding the BrokerURL returned by ActiveMQ?

Hi - on our test systems, when I query a connection for it's BrokerInfo I
get a BrokerURL of "tcp://activemq00:61616" - our actual host has a fully
qualified domain name that is more like "activemq00.us-east1-1a.foo.bar"

The short host name "activemq00" is largely useless, especially as our
slave broker is on "activemq00.us-east1-1b.foo.bar" - i.e. a different
availability zone, but it also returns a BrokerURL of "activemq00" :-/

This worries me, partly as I can't actually use BrokerURL at all, but also
I wonder if this would affect anything else that might be relying on this
URL.

Is there some way to override it and explicitly configure the broker with
it's externally visible host name?

The root cause, from some quick looking at the code, is probably calls
to InetAddress.getLocalHost().getHostName()

As the first answer to
http://stackoverflow.com/questions/7348711/recommended-way-to-get-hostname-in-java
says:

"Any attempt to determine the hostname by an IP address like this is bound
to fail in some circumstances"

- Korny
-- 
Kornelis Sietsma  korny at my surname dot com http://korny.info
.fnord { display: none !important; }