Reference

How to Upgrade ActiveMQ

ActiveMQ upgrade steps, written by the engineers who maintain the broker. Read the notice below before you run any of it against your own messaging environment.

Preparation · Upgrade · Confirm

The advice and commands detailed on this website should be used only as a reference in supporting your own messaging environment. You are solely responsible for determining the appropriateness of using and distributing any HYTE information and you assume all risks associated with its use, including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and the unavailability or interruption of operation. This information is not intended to be used in any situation where a failure could cause risk of injury or damage to property. This is not intended as legal advice and no warranty is provided with this information. Use at your own risk.

Preparation steps

Stage everything before the window

Three items sit ahead of the upgrade itself. Each one can be done while the broker is still running, so the maintenance window holds only the steps that need the broker stopped.

The sequence that follows moves one ActiveMQ installation to a new release on the same server, carrying the configuration and the message data across.

Preparation Steps

  1. Download updated version of HYTE MQ or Apache ActiveMQ
  2. Download updated version of Java JDK
  3. Stage files on the server
Upgrade

ActiveMQ Upgrade Steps

Paths and version numbers below are examples. Replace them with the installation folders and releases in use on your server.

Step 01

Stop the ActiveMQ server process

Consult with system administrators for proper way to shutdown.

  • Most Linux servers use systemd (or other service startup manager)
  • Windows servers usually use Computer Management > Services and Applications > Services

Default:

$ cd /opt/activemq/apache-activemq-5.18.2   # replace with correct installation folder
$ ./bin/activemq stop
Step 02

Extract the new installation

Extract new Java release

$ cd /opt/java
$ tar xzvf java-jdk-11.0.20.tar.gz

Extract new ActiveMQ release

$ cd /opt/activemq
$ tar zxvf apache-activemq-5.18.3-unix.tar.gz

Note: Use unzip on Windows

Step 03

Copy any config files from the old conf folder

Copy ActiveMQ broker configuration file

$ cp /opt/activemq/apache-activemq-5.18.2/conf/activemq.xml /opt/activemq/apache-activemq-5.18.3/conf

Copy users, groups and passwords

$ cp /opt/activemq/apache-activemq-5.18.2/conf/users.properties /opt/activemq/apache-activemq-5.18.3/conf

Optionally, SSL keystore

$ cp /opt/activemq/apache-activemq-5.18.2/conf/keystore.ks /opt/activemq/apache-activemq-5.18.3/conf

Copy any other custom configuration files over

Step 04

Update the Java path

Update bin/env file to point to new Java JDK as JAVA_HOME variable

Step 05

Copy kahadb folder over to recover any messages

$ cp -a /opt/activemq/apache-activemq-5.18.2/data/amq /opt/activemq/apache-activemq-5.18.3/data
Step 06

Start ActiveMQ

Consult with system administrators for proper way to startup.

  • Most Linux servers use systemd (or other service startup manager)
  • Windows servers usually use Computer Management > Services and Applications > Services

Default:

$ cd /opt/activemq/apache-activemq-5.18.3
$ ./bin/activemq start
Step 07

Confirm the upgrade in HYTE Console

Log into HYTE Console to confirm the new ActiveMQ server is running and is able to send and browse messages using a test queue

References

General References

Contact HYTE

For technical assistance, please open a support ticket in the HYTE Portal

Frequently Asked Questions

Do I lose queued messages when I upgrade ActiveMQ?

The kahadb folder holds the message data, and step 05 copies it from the old installation into the new one. Run that copy before starting the new broker so the messages are in place when it comes up. Stop the old broker first, as in step 01, rather than copying from a running installation.

Do I need to upgrade Java at the same time?

The preparation steps stage a Java JDK alongside the new ActiveMQ release, and step 04 points the bin/env file at it through the JAVA_HOME variable. Staging both together keeps the broker and its runtime on versions that were meant to run with each other. Download the JDK your target ActiveMQ release calls for.

Which configuration files do I copy to the new installation?

Step 03 copies the broker configuration file activemq.xml, the users.properties file holding users, groups and passwords, and the SSL keystore where one is in use. Any other custom configuration files in the old conf folder go across the same way. The copy runs from the old conf folder into the conf folder of the new installation.

Does this upgrade process work on Windows?

Yes, with two differences from the Linux sequence. Use unzip in place of tar when extracting the new release, and stop and start the broker through Computer Management, under Services and Applications, then Services. The configuration and kahadb copies work the same way on both.

How do I confirm the upgrade worked?

Log into HYTE Console and confirm the new ActiveMQ server is running. Send and browse messages using a test queue, which exercises the path an application takes. That check closes out step 07 of the upgrade.

Can HYTE help with an ActiveMQ upgrade?

These steps are published as a reference for teams running their own brokers. Customers who would rather have a second set of eyes on the change can open a support ticket in the HYTE Portal and talk it through with an engineer ahead of the window. ActiveMQ support is also available as an ongoing arrangement.

Second set of eyes

Running this against a production broker?

Sometimes a short conversation with a Messaging Platform Architect makes the plan clear before the window opens. Our engineers commit code upstream to Apache ActiveMQ, so the review comes from the people who maintain the release you are moving to.