Skip to content

Building Apache ActiveMQ

aborkar-ibm edited this page Jul 26, 2023 · 62 revisions

Building Apache ActiveMQ

Below versions of Apache ActiveMQ are available in respective distributions at the time of creation of these build instructions:

  • Ubuntu 20.04 has 5.15.11
  • Ubuntu 22.04 has 5.16.1
  • Ubuntu 23.04 has 5.17.2

General Notes:

  • When following the steps below please use a standard permission user unless otherwise specified.

  • A directory /<source_root>/ will be referred to in these instructions, this is a temporary writable directory anywhere you'd like to place it.

Apache ActiveMQ binaries are available and can be downloaded from here. To use these binaries, different Java flavors can be installed on mentioned distributions.

Note: Apache ActiveMQ(v5.18.2) was verified at the time of creation of these instructions

1. Install Java

  • RHEL (7.8, 7.9, 8.6, 8.8, 9.0, 9.2)

    • With OpenJDK 11

      sudo yum install -y git java-11-openjdk
    • With OpenJDK 17 (Not for RHEL 7.x)

      sudo yum install -y git java-17-openjdk-devel
    • With IBM Semeru Runtime (previously known as AdoptOpenJDK openj9)

      sudo yum install -y net-tools wget tar

      Download and install IBM Semeru Runtime (Java 11 or Java 17) from here, unzip binary and update JAVA_HOME and PATH accordingly.

    • With Eclipse Adoptium Temurin Runtime (previously known as AdoptOpenJDK hotspot)

      sudo yum install -y net-tools wget tar

      Download and install Eclipse Adoptium Temurin Runtime (Java 11 or Java 17) from here, unzip binary and update JAVA_HOME and PATH accordingly.

  • SLES 12 SP5

    • With OpenJDK 11:

      sudo zypper install -y java-11-openjdk-devel net-tools wget tar gzip
    • With IBM Semeru Runtime (previously known as AdoptOpenJDK openj9)

      sudo zypper install -y net-tools wget tar gzip

      Download and install IBM Semeru Runtime (Java 11 or Java 17) from here, unzip binary and update JAVA_HOME and PATH accordingly.

    • With Eclipse Adoptium Temurin Runtime (previously known as AdoptOpenJDK hotspot)

      sudo zypper install -y net-tools wget tar gzip

      Download and install Eclipse Adoptium Temurin Runtime (Java 11 or Java 17) from here, unzip binary and update JAVA_HOME and PATH accordingly.

  • SLES (15 SP4, 15 SP5)

    • With OpenJDK 11:

      sudo zypper install -y java-11-openjdk-devel net-tools-deprecated wget tar gzip
    • With OpenJDK 17

      sudo zypper install -y --auto-agree-with-licenses java-17-openjdk java-17-openjdk-devel net-tools-deprecated wget tar gzip
    • With IBM Semeru Runtime (previously known as AdoptOpenJDK openj9)

      sudo zypper install -y net-tools-deprecated wget tar gzip

      Download and install IBM Semeru Runtime (Java 11 or Java 17) from here, unzip binary and update JAVA_HOME and PATH accordingly.

    • With Eclipse Adoptium Temurin Runtime (previously known as AdoptOpenJDK hotspot)

      sudo zypper install -y net-tools wget tar gzip

      Download and install Eclipse Adoptium Temurin Runtime (Java 11 or Java 17) from here, unzip binary and update JAVA_HOME and PATH accordingly.

  • Ubuntu (20.04, 22.04, 23.04)

    • With OpenJDK 11

      sudo apt-get update
      sudo apt-get install -y openjdk-11-jdk net-tools wget tar
    • With OpenJDK 17

      sudo apt-get install -y openjdk-17-jdk net-tools wget tar
    • With IBM Semeru Runtime (previously known as AdoptOpenJDK openj9)

      sudo apt-get update
      sudo apt-get install -y net-tools wget tar

      Download and install IBM Semeru Runtime (Java 11 or Java 17) from here, unzip binary and update JAVA_HOME and PATH accordingly.

    • With Eclipse Adoptium Temurin Runtime (previously known as AdoptOpenJDK hotspot)

      sudo apt-get update
      sudo apt-get install -y net-tools wget tar

    Download and install Eclipse Adoptium Temurin Runtime (Java 11 or Java 17) from here, unzip binary and update JAVA_HOME and PATH accordingly.

Note: At the time of creation of these build instructions, Apache ActiveMQ 5.18.0 was verified IBM Semeru Runtime Open Edition and Eclipse Adoptium Temurin Runtime version 11.0.18.0 (build 11.0.18+10) and 17.0.6.0 (build 17.0.6+10).

2. Set JAVA_HOME

  • Set JAVA_HOME and PATH

    export JAVA_HOME=<Path to Java>
    export PATH=$JAVA_HOME/bin:$PATH

3. Start ActiveMQ

To start the process, extract binary tarball to /<source_root>/ and follow steps given below

export SOURCE_ROOT=/<source_root>/
export PATH=$JAVA_HOME/bin:$PATH
cd $SOURCE_ROOT/<apache-activemq_binary_folder>/bin
./activemq console  # Run ActiveMQ as a foreground process or
./activemq start  # Run ActiveMQ as a daemon process

4. Test the Installation

  • Using the administrative interface

    Open the administrative interface
    URL: http://<HOST_NAME>:8161/admin
    Login: admin
    Password: admin
    
    • Navigate to "Queues"
    • Add a queue name and click create
    • Send test message by clicking on "Send to"

    Note: If the administrative interface is not accessible when the activemq process is up, you can have the following change and restart the activemq process

    sed -i "s/127.0.0.1/0.0.0.0/" $SOURCE_ROOT/<apache-activemq_binary_folder>/conf/jetty.xml
    cd $SOURCE_ROOT/<apache-activemq_binary_folder>/bin
    ./activemq stop
    ./activemq console # Run ActiveMQ as a foreground process or
    ./activemq start # Run ActiveMQ as a daemon process
  • Logfile and console output

    • If ActiveMQ is up and running without problems, the Unix command shell will display information similar to the following log line: (see stdout output or $SOURCE_ROOT/apache-activemq_binary_folder/data/activemq.log)
      INFO | Apache ActiveMQ 5.18.2 (localhost, ID:6d48ba2fefe3-43067-1681105731069-0:1) started
      
  • Listen port

    • ActiveMQ's default port is 61616. From another window, run netstat command and search for port 61616.
    netstat -nl | grep 61616
    
  • Get more ActiveMQ status

    ./activemq bstat
    
  • Stopping ActiveMQ

    ./activemq stop
    

References:

Clone this wiki locally