Hi Sebastian,

An easy way is to modify the bin/activemq script to pass across an
activemq.hostname parameter.

e.g.  in bin/activemq, add:

ACTIVEMQ_HOSTNAME=`hostname -f`

and then in the line :

exec "$JAVACMD" $ACTIVEMQ_DEBUG_OPTS $ACTIVEMQ_OPTS -Dactivemq.classpath="${
ACTIVEMQ_CLASSPATH}" -Dactivemq.home="${ACTIVEMQ_HOME}" -Dactivemq.base="${ACTIV
EMQ_BASE}" -jar "${ACTIVEMQ_HOME}/bin/run.jar" start $@


add in  "-Dactivemq.hostname=${ACTIVEMQ_HOSTNAME} ".


If you use Java Wrapper and an init.d you can do a similar logic - set
the hostname in the init.d script as before, and in the wrapper.conf
do something like:

wrapper.java.additional.3=-Dactivemq.hostname=%ACTIVEMQ_HOSTNAME%

We use the second method in production successfully.

cheers,

James.


2009/12/4 Sebastian Rodriguez <srodrig...@gmail.com>:
> Dear all,
> In need your advice in the following configuration scenario: we are
> deploying ActiveMQ 5.3 in a big number of machines. The configuration is
> exactly the same for all the machines, the only difference is, of course,
> the broker name. As they need to be unique, they need to be changed in all
> the machines, creating a very repetitive yet time consuming task that would
> be to modify the activemq.xml file.
> Is there a way to use a environment variables in the configuration file (to
> put the hostname of the machine as the broker name)?
> I see there is already some configuration possible through the
> eg.springframework.beans.factory.config.PropertyPlaceholderConfigurer class,
> but those properties are static. I guess I can create a deploy script that
> created my own properties file that will put the hostname in it, but that
> property would only be created or refreshed when I deploy the service.
> This is not the ideal solution as the hostname might change in the machine
> life, so I'm seeking for your advice in the matter.
> Thank you very much for your help,
> --
> Sebastien Rodriguez
>

Reply via email to