Building Apache ActiveMQ - linux-on-ibm-z/docs GitHub Wiki

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.10 has 5.17.2
  • Ubuntu 24.04 has 5.17.6

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(v6.1.2) was verified at the time of creation of these instructions

1. Install Dependencies

  • RHEL (7.8, 7.9, 8.8, 8.9, 9.2, 9.3)

    sudo yum install -y wget tar net-tools curl procps
  • SLES (12 SP5, 15 SP5)

    sudo zypper install -y net-tools wget tar gzip curl   # For SLES 12 SP5
    sudo zypper install -y net-tools-deprecated wget tar gzip curl # For SLES 15 SP5
  • Ubuntu (20.04, 22.04, 23.10, 24.04)

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

2. Install Java

  • With IBM Semeru Runtime (previously known as AdoptOpenJDK openj9).

    • Download and install IBM Semeru Runtime (Java 17 or 21) from here.
  • With Eclipse Adoptium Temurin Runtime (previously known as AdoptOpenJDK hotspot)

    • Download and install Eclipse Adoptium Temurin Runtime (Java 17 or 21) from here.
  • With OpenJDK 17

    • RHEL (8.8, 8.9, 9.2, 9.3)
      sudo yum install -y java-17-openjdk-devel 
    • SLES 15 SP5
      sudo zypper install -y --auto-agree-with-licenses java-17-openjdk java-17-openjdk-devel
    • Ubuntu (20.04, 22.04, 23.10, 24.04)
      sudo apt-get install -y openjdk-17-jdk
  • With OpenJDK 21

    • RHEL (8.8, 8.9, 9.2, 9.3)
      sudo yum install -y java-21-openjdk-devel
    • Ubuntu (20.04, 22.04, 23.10, 24.04)
      sudo apt-get install -y openjdk-21-jdk

Note: Versions (v17.0.6 and v21.0.1) of IBM Semeru Runtime and (v17.0.6 and v21.0.2) of Adoptium Temurin Runtime were used at the time of creation of these instructions.

3. Set JAVA_HOME

  • Set JAVA_HOME and PATH

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

4. 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

5. 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 6.1.2 (localhost, ID:8c8f37d2e149-38405-1714118063766-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:

⚠️ **GitHub.com Fallback** ⚠️