이 콘텐츠는 선택한 언어로 제공되지 않습니다.

Chapter 33. Monitoring Messaging Statistics


When statistics collection is enabled for a messaging server in the messaging-activemq subsystem, you can view runtime statistics for resources on the messaging server.

33.1. Enabling Messaging Statistics

Because it can negatively impact performance, statistics collection for the messaging-activemq subsystem is not enabled by default. You do not need to enable queue statistics to obtain basic information, such as as number of messages on a queue or the number of messages added to a queue. Those statistics are available using queue attributes without requiring that you set statistics-enabled to true.

You can enable additional statistics collection using the management CLI or the management console.

Enable Messaging Statistics Using the Management CLI

The following management CLI command enables the collection of statistics for the default messaging server.

/subsystem=messaging-activemq/server=default:write-attribute(name=statistics-enabled,value=true)

Pooled connection factory statistics are enabled separately from the other messaging server statistics. Use the following command to enable statistics for a pooled connection factory.

/subsystem=messaging-activemq/server=default/pooled-connection-factory=activemq-ra:write-attribute(name=statistics-enabled,value=true)

Reload the server for the changes to take effect.

Enable Messaging Statistics Using the Management Console

Use the following steps to enable statistics collection for a messaging server using the management console.

  1. Navigate to Configuration Subsystems Messaging (ActiveMQ) Server.
  2. Select the server and click View.
  3. Click Edit under the Statistics tab.
  4. Set the Statistics Enabled field to ON and click Save.

Pooled connection factory statistics are enabled separately from the other messaging server statistics. Use the following steps to enable statistics collection for a pooled connection factory.

  1. Navigate to Configuration Subsystems Messaging (ActiveMQ) Server.
  2. Select the server, select Connections, and click View.
  3. Select the Pooled Connection Factory tab.
  4. Select the pooled connection factory and click Edit under the Attributes tab.
  5. Set the Statistics Enabled field to ON and click Save.
  6. Reload the server for the changes to take effect.

33.2. Viewing Messaging Statistics

You can view runtime statistics for a messaging server using the management CLI or management console.

View Messaging Statistics Using the Management CLI

You can view messaging statistics using the following management CLI commands. Be sure to include the include-runtime=true argument as statistics are runtime information.

  • View statistics for a queue.

    /subsystem=messaging-activemq/server=default/jms-queue=DLQ:read-resource(include-runtime=true)
    {
        "outcome" => "success",
        "result" => {
            "consumer-count" => 0,
            "dead-letter-address" => "jms.queue.DLQ",
            "delivering-count" => 0,
            "durable" => true,
            ...
        }
    }
  • View statistics for a topic.

    /subsystem=messaging-activemq/server=default/jms-topic=testTopic:read-resource(include-runtime=true)
    {
        "outcome" => "success",
        "result" => {
            "delivering-count" => 0,
            "durable-message-count" => 0,
            "durable-subscription-count" => 0,
            ...
        }
    }
  • View statistics for a pooled connection factory.

    /subsystem=messaging-activemq/server=default/pooled-connection-factory=activemq-ra/statistics=pool:read-resource(include-runtime=true)
    {
        "outcome" => "success",
        "result" => {
            "ActiveCount" => 1,
            "AvailableCount" => 20,
            "AverageBlockingTime" => 0L,
            "AverageCreationTime" => 13L,
            "AverageGetTime" => 14L,
            ...
        }
    }
    Note

    Pooled connection factory statistics are enabled separately from the other messaging server statistics. See Enabling Messaging Statistics for instructions.

View Messaging Statistics Using the Management Console

To view messaging statistics from the management console, navigate to the Messaging (ActiveMQ) subsystem from the Runtime tab, and select the server. Select a destination to view its statistics.

Note

The Prepared Transactions page is where you can view, commit, and roll back prepared transactions. See Managing Messaging Journal Prepared Transactions for more information.

See Messaging Statistics for a detailed list of all available statistics.

33.3. Configuring Message Counters

You can configure the following message counter attributes for a messaging server.

  • message-counter-max-day-history: The number of days the message counter history is kept.
  • message-counter-sample-period: How often, in milliseconds, the queue is sampled.

The management CLI command to configure these options uses the following syntax. Be sure to replace STATISTICS_NAME and STATISTICS_VALUE with the statistic name and value you want to configure.

/subsystem=messaging-activemq/server=default::write-attribute(name=STATISTICS_NAME,value=STATISTICS_VALUE)

For example, use the following commands to set the message-counter-max-day-history to five days and the message-counter-sample-period to two seconds.

/subsystem=messaging-activemq/server=default:write-attribute(name=message-counter-max-day-history,value=5)
/subsystem=messaging-activemq/server=default:write-attribute(name=message-counter-sample-period,value=2000)

33.4. Viewing the Message Counter and History for a Queue

You can view the message counter and message counter history for a queue using the following management CLI operations.

  • list-message-counter-as-json
  • list-message-counter-as-html
  • list-message-counter-history-as-json
  • list-message-counter-history-as-html

The management CLI command to use display these values uses the following syntax. Be sure to replace QUEUE_NAME and OPERATION_NAME with the queue name and operation you want to use.

/subsystem=messaging-activemq/server=default/jms-queue=QUEUE_NAME:OPERATION_NAME

For example, use the following command to view the message counter for the TestQueue queue in JSON format.

/subsystem=messaging-activemq/server=default/jms-queue=TestQueue:list-message-counter-as-json
{
    "outcome" => "success",
    "result" => "{\"destinationName\":\"TestQueue\",\"destinationSubscription\":null,\"destinationDurable\":true,\"count\":0,\"countDelta\":0,\"messageCount\":0,\"messageCountDelta\":0,\"lastAddTimestamp\":\"12/31/69 7:00:00 PM\",\"updateTimestamp\":\"2/20/18 2:24:05 PM\"}"
}

33.5. Reset the Message Counter for a Queue

You can reset the message counter for a queue using the reset-message-counter management CLI operation.

/subsystem=messaging-activemq/server=default/jms-queue=TestQueue:reset-message-counter
{
    "outcome" => "success",
    "result" => undefined
}
Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다. 최신 업데이트를 확인하세요.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

Theme

© 2026 Red Hat
맨 위로 이동