ActiveMQ is an open-source, message-oriented middleware (MOM) used for implementing communication between distributed applications. It provides reliable, asynchronous and loosely coupled communication to help in delivering messages between applications. This guide will take you through the process of installing and configuring Apache ActiveMQ on Linux servers.
Features
- Supports multiple messaging protocols (such as JMS, AMQP, STOMP, MQTT, etc)
- Supports various messaging patterns (such as publish-subscribe, point-to-point, etc)
- Robust, scalable and high-performance architecture
- Supports clustering, allowing multiple brokers to work together as a single logical broker
- Supports JMX, allowing easy management and monitoring of the broker
Use Cases
- Enterprise Messaging: Used to decouple the applications and allow for asynchronous communication between them.
- Service Oriented Architecture (SOA): ActiveMQ can act as an intermediary between services, enabling communication and integration between them.
- IoT: Can be used to process and route high volumes of messages from IoT devices.
Apache ActiveMQ versions, Release Dates and Java compatibility:
Here I am listing Apache ActiveMQ versions, its released date and Java compatibility, so you will get idea to install most updated Apache ActiveMQ version for your production server.
Versions | Released Dates | Java compatibility |
5.17.3 | Dec 4th, 2022 | 11+ |
5.16.5 | May 2nd, 2022 | 8+ |
5.15.15 | Apr 28, 2021 | 8 |
5.14.5 | Apr 11, 2017 | 8 |
Steps to install Apache ActiveMQ on Linux server
Apache ActiveMQ doesn’t come with installation package. The best way to install Apache ActiveMQ is to download their binaries from Apache official websites. This tutorial will help you to install latest Apache ActiveMQ on Linux servers like CentOS, RHEL, Oracle Linux, Rocky Linux, AlmaLinux, Ubuntu or Debian.
Prerequisites:
- sudo privileges.
- Stable internet connection.
- Latest JAVA. Click here for JAVA installation.
- Enable required ports in firewall
Install the prerequisites:
For RHEL, CentOS and Oracle Linux 7 server
# yum install wget gzip -y
For RHEL, CentOS, Oracle Linux or Rocky Linux 8 and 9 server
# dnf install wget gzip -y
For Ubuntu and Debian server
# apt install wget gzip -y
Now download Apache ActiveMQ from Official website:
# cd /opt && wget https://dlcdn.apache.org/activemq/5.17.3/apache-activemq-5.17.3-bin.tar.gz
Extract downloaded ActiveMQ tar file and rename it:
# tar -xvzf apache-activemq-*tar.gz && rm -rf apache-activemq-*.tar.gz && mv apache-activemq-* activemq
create a activemq user and group:
# addgroup --quiet --system activemq
# adduser --quiet --system --ingroup activemq --no-create-home --disabled-password activemq
Change the ownership of /opt/activemq directory:
# chown -R activemq:activemq /opt/activemq
Configure Apache ActiveMQ
Set jvm memory configuration:
We can set 75% of total memory to ActiveMQ for better performance so we need to edit env file if we have 4GB of memory on server.
# sed -i 's/-Xmx1G/-Xmx3G/' /opt/activemq/bin/env
ActiveMQ Admin web interface:
To access ActiveMQ Admin web interface so we need to edit jetty.xml file.
# sed -i 's/127.0.0.1/0.0.0.0/' /opt/activemq/conf/jetty.xml
Create Systemd Service for ActiveMQ service:
cat <<'EOT' | sudo tee /etc/systemd/system/activemq.service
[Unit]
Description=Apache ActiveMQ
After=network.target
[Service]
Type=forking
User=activemq
Group=activemq
ExecStart=/opt/activemq/bin/activemq start
ExecStop=/opt/activemq/bin/activemq stop
[Install]
WantedBy=multi-user.target
EOT
Reload Systemd configuration changes and start ActiveMQ service:
# systemctl daemon-reload
# systemctl start activemq.service
Access ActiveMQ default Admin dashboard:
URL: http://server_ip_address:8161/admin
Login user: admin
Login password: admin
ActiveMQ Transport Connectors and Ports
Transport Connector | Port numbers |
openwire / tcp | 61616 |
amqp | 5672 |
stomp | 61613 |
mqtt | 1883 |
ws | 61614 |
Managing Apache ActiveMQ service
let’s review some basic management commands.
Verify installed version of ActiveMQ:
# /opt/activemq/bin/activemq --version
Check status of the ActiveMQ service:
# systemctl status activemq.service
Restart the ActiveMQ service:
# systemctl restart activemq.service
If you want to stop ActiveMQ service:
# systemctl stop activemq.service
ActiveMQ service is disabled to start automatically when the server boots. If you want to enable it at startup, run:
# systemctl enable activemq.service
Disable the service to start up at boot:
# systemctl disable activemq.service
Uninstall Apache ActiveMQ from server
To completely remove Apache ActiveMQ from a system, you must remove the ActiveMQ applications, the configuration files, and any directories containing data.
Warning: This process will completely remove Apache ActiveMQ and its configuration. This process is not reversible, so ensure that all of your configuration and data is backed up before proceeding.
# systemctl stop activemq.service && systemctl disable activemq.service
# rm -rf /opt/activemq
Conclusion
Congratulations! We’ve installed Apache ActiveMQ on Linux system like CentOS, RHEL, Rocky Linux, AlmaLinux, Ubuntu and Debian. We hope this 2 minutes stuff helped you and thank you for visiting our website.
Cheers!!!
I have to thank you for the efforts youve put in writing this blog. Im hoping to check out the same high-grade blog posts by you later on as well. In fact, your creative writing abilities has encouraged me to get my own website now 😉
help me write a descriptive essay