Apache ActiveMQ is a popular Java-based open source message-oriented middleware (software for communication between distributed applications) from Apache Foundation Software. ActiveMQ processes incoming messages from applications and communicates them across your infrastructure.

Prerequisites

  1. In standard ActiveMQ installation (extraction of tar), change the XML by configuring the following:
    <broker useJmx="true" brokerName="BROKER1">
    ...
    </broker>
    
  2. Modify the ActiveMQ binary file by adding the following lines and start ActiveMQ:
    ACTIVEMQ_SUNJMX_START="-Djava.rmi.server.hostname=localhost  -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.port=1099 -Dcom.sun.management.jmxremote.rmi.port=1099  -Dcom.sun.management.jmxremote.ssl=false"
    
  3. For Virtual Machines, install the Linux Agent.

Configuring the credentials

Configure the credentials in the directory /opt/opsramp/agent/conf/app.d/creds.yaml:

activemq:
- name: activemq
  user: <username>
  pwd: <Password>
  encoding-type: plain
  labels:
    key1: val1
    key2: val2

Configuring the application

Virtual machine

Configure the application in the directory /opt/opsramp/agent/conf/app/discovery/auto-detection.yaml:

- name: activemq
  instance-checks:
    process-check:
      - activemq
    port-check:
      - 61616
    command-check:
      - "/opt/activemq/bin/activemq --version >/dev/null 2>&1;echo $?"
  mon-type: "jmx"
  misc:
    jmx-port: "1099"

Docker environment

Configure the application in the directory /opt/opsramp/agent/conf/app/discovery/auto-container-detection.yaml:

- name: activemq
  container-checks:
    image-check:
      - activemq
    port-check:
      - 61616
  mon-type: "jmx"
  misc:
    jmx-port: "1099"

Kubernetes environment

Configure the application in config.yaml:

- name: activemq
  container-checks:
    image-check:
      - activemq
    port-check:
      - 61616
  mon-type: "jmx"
  misc:
    jmx-port: "1099"

Validate

Go to Resources under the Infrastructure tab to check if your resources are onboarded and the metrics are collected.

Metrics

OpsRamp MetricMetric Display NameUnit
activemq_Broker_MemoryPercentUsage

Percentage of memory limit used by the Broker.
Broker Memory Usagepercent
activemq_Broker_StorePercentUsage

Space used by the Message Store for Broker.
Broker Store Usagepercent
activemq_Broker_TempPercentUsage

Space used by the store for temporary messages.
Broker Temp Usagepercent
activemq_jvm_GarbageCollector_CollectionCount

Number of garbage objects collected.
JVM GC collection_countObjects collected
activemq_jvm_GarbageCollector_CollectionTime

Time taken for collection of the garbage objects.
JVM GC collection_timeseconds
activemq_jvm_HeapMemoryUsage_committed

Heap memory committed (in MB) for the server.
JVM Mem heap_committedMB
activemq_jvm_HeapMemoryUsage_used

Heap memory usage (in MB) of the server.
JVM Mem heap_usedMB
activemq_jvm_NonHeapMemoryUsage_committed

Non-heap memory committed (in MB) for the server.
JVM Mem non_heap_committedMB
activemq_jvm_NonHeapMemoryUsage_used

Non-heap memory usage (in MB) of the server.
JVM Mem non_heap_usedMB
activemq_jvm_OperatingSystem_OpenFileDescriptorCount

Number of Open file descriptors of the server.
JVM OpenFDsOpen FDs
activemq_jvm_Threading_ThreadCount

Number of threads.
JVM ThreadsThreads
activemq_jvm_Runtime_Uptime

Uptime of the server.
UptimeMinutes
activemq_AverageEnqueueTime

Average time for which messages remained enqueued or the average time taken by the consumers to successfully process messages.
Average Enqueue Timemilliseconds
activemq_MaxEnqueueTime

Maximum time that messages remained enqueued.
Max Enqueue Timemilliseconds
activemq_MemoryPercentUsage

Percentage of the memory limit used by queues.
Queue Memory Usagepercent
activemq_Queue_ConsumerCount

Number of consumers subscribed to this destination.
Consumer CountConsumers
activemq_Queue_ProducerCount

Number of producers.
Producer CountProducers
activemq_Queue_MinEnqueueTime

Minimum time messages remained enqueued.
Min Enqueue Timemilliseconds
activemq_Queue_QueueSize

Number of messages that currently reside in the queue- potentially dispatched but unacknowledged.
Queue SizePending Messages
activemq_Queue_DequeueCount

Number of messages that have been acknowledged (and removed) from the destination since last restart.
Dequeue CountDequeued Messages
activemq_Queue_DispatchCount

Number of messages that have been dispatched (Dequeue + Inflight).
Dispatch CountDispatched Messages
activemq_Queue_EnqueueCount

Number of messages that have been sent to the destination since last restart.
Enqueue CountEnqueued Messages
activemq_Queue_ExpiredCount

Number of expired messages.
Expired CountExpired Messages
activemq_Queue_InFlightCount

Number of messages sent to a destination without receiving an acknowledgement.
InFlight CountInFlight Messages