To upgrade any ActiveMQ component manually from one version to another version follow the below instructions.
- Download the latest ActiveMQ version from https://activemq.apache.org/components/classic/download/ and place it in
$APIN_HOME/actmq
- Stop the ActiveMQ service by using the command
./stop.sh mq
in$APIN_HOME/sbin
. - Untar the downloaded package using the following command
tar -zxvf apache-activemq-5.x.x.tar.gz
- apache-activemq-5.x.x folder is obtained which will be the current version.
- Unlink the old version by using the command
unlink current
- Navigate to
$APIN_HOME/actmq/current/conf/
edit activemq.xml file as follows, in the broker xmlns tag add the following property.schedulePeriodForDestinationPurge="300000"
which looks as following
<broker xmlns="http://activemq.apache.org/schema/core" brokerName="JKMessageBus" dataDirectory="${activemq.data}" schedulePeriodForDestinationPurge="300000">
- Add the following line within these tags:
<destinationPolicy>
</destinationPolicy>
<policyEntry queue="jkool.client.>" gcInactiveDestinations="true" inactiveTimoutBeforeGC="120000" sendAdvisoryIfNoConsumers="true"/>
which looks as following,
- To be able to connect to the web console remotely, it must run on a local machine. Restore the "host" value for bean "jettyPort" from "127.0.0.1" back to "0.0.0.0" in the jetty.xml file found in the following path
$APIN_HOME/actmq/current/conf/jetty.xml
:<bean id="jettyPort" class="org.apache.activemq.web.WebConsolePort" init-method="start">
<!-- the default port number for the web console -->
<property name="host" value="0.0.0.0"/>
<property name="port" value="8161"/>
</bean> - Link the current version using the command
ln -s apache-activemq-5.x.x current
. - Change the ActiveMQ path in
$APIN_HOME/sbin/apin_env.sh
as follows:
export ACTIVEMQ_HOME=`realpath $APIN_HOME/actmq/current`
Please make sure that the right quotes are used. - After all the below steps have been completed, restart the ActiveMQ service in
$APIN_HOME/actmq
using the command./start.sh mq
to apply the changes.