An icon for a calendar

Published June 1, 2022

How to Install Apache ActiveMQ on Debian 11

How to Install Apache ActiveMQ on Debian 11

Apache ActiveMQ is a free and open-source message broker developed by Apache Software Foundation. It is one of the well-known message brokers that supports multiple protocols such as AMQP, MQTT, Stomp, and OpenWire. It is written in Java and fully compliant with JMS 1.1 standards.

Apache ActiveMQ is one of the most popular message brokers that support different types of programming languages that can be deployed on multiple platforms. It is an enterprise-grade message broker that provides high availability, scalability, reliability,

high performance, and security.

In this post, you will learn how to install the Apache ActiveMQ Multi-Protocol message broker on the Debian 11 system. This tutorial includes the installation of Java OpenJDK and JRE and the configuration of the JAVA_HOME environment variable.

Prerequisites

  • A Linux server Debian 11.
  • A non-root user with root administrator privileges.

Install Java OpenJDK and JRE

First, you will need to install the Java OpenJDK and JRE before installing the Apache ActiveMQ. The current version of Apache ActiveMQ required a minimum Java JRE v1.8.

On the Debian 11 repository, there are multiple versions of Java OpenJDK and JRE. But you will be installing Java OpenJDK and JRE v1.11 for the Apache ActiveMQ.

Refresh and update your Debian repository using the below command.

sudo apt update

Next, install java OpenJDK and JRE using the apt command below.

sudo apt install default-jdk default-jre

Type Y to confirm the installation and press ENTER to continue.

Now move to the next step to start the Apache ActiveMQ installation.

Installing Apache ActiveMQ

The Apache ActiveMQ provides multiple versions of the ActiveMQ. In this example, you will be installing the Apache ActiveMQ Classic, which is powerful and supports multiple messaging protocols such as AMQP, MQTT, Stomp, and OpenWire.

Additionally, you can install another version such as ActiveMQ Artemis in the same way as the ActiveMQ classic.

To start the installation, run the below command to download the Apache ActiveMQ v5.17 (the latest version during this writing).

wget https://dlcdn.apache.org//activemq/5.17.1/apache-activemq-5.17.1-bin.tar.gz

After the download process is completed, you will see the file apache-activemq-5.17.1-bin.tar.gz. Extract it using the following command.

tar -xzvf apache-activemq-5.17.1-bin.tar.gz

Next, move the extracted directory apache-activemq-5.17.1 to the /opt/activemq.

mv apache-activemq-5.17.1 /opt/activemq

After installation is completed, check the Java version using the following command.

java -version

On the below screenshot, you will see that Java OpenJDK 1.11 is installed on the Debian system.

Go to the next step to set up the JAVA_HOME environment variable.

Setting Up JAVA_HOME Environment Variable

The Apache ActiveMQ required the JAVA_HOME environment variable to be configured correctly to the jvm installation directory, which is available at /usr/lib/jvm/java-11-openjdk-amd64 directory. And in a simple way, you can set up the JAVA_HOME environment variable through the “~/.bashrc” file.

Add the configuration to the “~/.bashrc” configuration file using the below command.

This article originally appeared on techblog.com, to read the full article, click here.

The Nastel platform supports monitoring and tracking of ActiveMQ in all environments.