3.6. Checking the health of brokers, queues and the cluster


AMQ Broker includes a command-line utility that enables you to perform various health checks on brokers and queues in your broker topology. If your brokers are clustered, you can also use the utility to check the health of your cluster topology.

Procedure

  1. See the list of checks that you can run for a particular broker (that is, node) in your broker topology.

    $ <broker_instance_dir>/bin/artemis help check node

    You see output that describes the set of options that you can use with the artemis check node command.

    NAME
            artemis check node - Check a node
    
    SYNOPSIS
            artemis check node [--backup] [--clientID <clientID>]
                    [--diskUsage <diskUsage>] [--fail-at-end] [--live]
                    [--memoryUsage <memoryUsage>] [--name <name>] [--password <password>]
                    [--peers <peers>] [--protocol <protocol>] [--silent]
                    [--timeout <timeout>] [--up] [--url <brokerURL>] [--user <user>]
                    [--verbose]
    
    OPTIONS
            --backup
                Check that the node has a backup
    
            --clientID <clientID>
                ClientID to be associated with connection
    
            --diskUsage <diskUsage>
                Disk usage percentage to check or -1 to use the max-disk-usage
    
            --fail-at-end
                If a particular module check fails, continue the rest of the checks
    
            --live
                Check that the node has a live
    
            --memoryUsage <memoryUsage>
                Memory usage percentage to check
    
            --name <name>
                Name of the target to check
    
            --password <password>
                Password used to connect
    
            --peers <peers>
                Number of peers to check
    
            --protocol <protocol>
                Protocol used. Valid values are amqp or core. Default=core.
    
            --silent
                It will disable all the inputs, and it would make a best guess for any required input
    
            --timeout <timeout>
                Time to wait for the check execution, in milliseconds
    
            --up
                Check that the node is started, it is executed by default if there are no other checks
    
            --url <brokerURL>
                URL towards the broker. (default: tcp://localhost:61616)
    
            --user <user>
                User used to connect
    
            --verbose
                Adds more information on the execution
  2. For example, check that the disk usage of the local broker is below the maximum disk usage configured for the broker.

    $ <broker_instance_dir>/bin/artemis check node --url tcp://localhost:61616 --diskUsage -1
    
    Connection brokerURL = tcp://localhost:61616
    Running NodeCheck
    Checking that the disk usage is less then the max-disk-usage ... success
    Checks run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.065 sec - NodeCheck

    In the preceding example, specifying a value of -1 for the --diskUsage option means that the utility checks disk usage against the maximum disk usage configured for the broker. The maximum disk usage of a broker is configured using the max-disk-usage parameter in the broker.xml configuration file. The value specified for max-disk-usage represents the percentage of available physical disk space that the broker is allowed to consume.

  3. See the list of checks that you can run for a particular queue in your broker topology.

    $ <broker_instance_dir>/bin/artemis help check queue

    You see output that describes the set of options that you can use with the artemis check queue command.

    NAME
            artemis check queue - Check a queue
    
    SYNOPSIS
            artemis check queue [--browse <browse>] [--clientID <clientID>]
                    [--consume <consume>] [--fail-at-end] [--name <name>]
                    [--password <password>] [--produce <produce>] [--protocol <protocol>]
                    [--silent] [--timeout <timeout>] [--up] [--url <brokerURL>]
                    [--user <user>] [--verbose]
    
    OPTIONS
            --browse <browse>
                Number of the messages to browse or -1 to check that the queue is
                browsable
    
            --clientID <clientID>
                ClientID to be associated with connection
    
            --consume <consume>
                Number of the messages to consume or -1 to check that the queue is consumable
    
            --fail-at-end
                If a particular module check fails, continue the rest of the checks
    
            --name <name>
                Name of the target to check
    
            --password <password>
                Password used to connect
    
            --produce <produce>
                Number of the messages to produce
    
            --protocol <protocol>
                Protocol used. Valid values are amqp or core. Default=core.
    
            --silent
                It will disable all the inputs, and it would make a best guess for any required input
    
            --timeout <timeout>
                Time to wait for the check execution, in milliseconds
    
            --up
                Check that the queue exists and is not paused, it is executed by default if there are no other checks
    
            --url <brokerURL>
                URL towards the broker. (default: tcp://localhost:61616)
    
            --user <user>
                User used to connect
    
            --verbose
                Adds more information on the execution
  4. The utility can execute multiple options with a single command. For example, to check production, browsing, and consumption of 1000 messages on the default helloworld queue on the local broker, use the following command:

    $ <broker_instance_dir>/bin/artemis check queue --name helloworld --produce 1000 --browse 1000 --consume 1000
    
    Connection brokerURL = tcp://localhost:61616
    Running QueueCheck
    Checking that a producer can send 1000 messages to the queue helloworld ... success
    Checking that a consumer can browse 1000 messages from the queue helloworld ... success
    Checking that a consumer can consume 1000 messages from the queue helloworld ... success
    Checks run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.882 sec - QueueCheck

    In the preceding example, observe that you did not specify a broker URL when running the queue check. If you do not explicitly specify a URL, the utility uses a default value of tcp://localhost:61616.

  5. If your brokers are clustered, see the list of checks that you can run for the cluster topology.

    $ <broker_instance_dir>/bin/artemis help check cluster

    You see output that describes the set of options that you can use with the artemis check cluster command.

    NAME
            artemis check cluster - Verify if all the nodes on the cluster match the same topology and time
            configuration.
    
    
    SYNOPSIS
            artemis check cluster [--acceptor=<acceptor>]
                    [--clientID=<clientID>] [--password=<password>]
                    [--protocol=<protocol>] [--silent] [--url=<brokerURL>]
                    [--user=<user>] [--variance=<variance>] [--verbose]
    OPTIONS
          --acceptor=<acceptor>
              Name used to find the default connection URL on the acceptor list. If an acceptor with that name cannot
              be found, the command looks for a connector with the same name.
    
            --clientID <clientID>
                ClientID to be associated with connection.
    
            --password <password>
                Password used to connect.
    
            --protocol <protocol>
                Protocol used. Valid values are amqp or core. Default=core.
    
            --silent
                Disables all the input options and make a best guess for any required input.
    
            --url <brokerURL>
                URL of the broker (default: tcp://localhost:61616).
    
            --user <user>
                User used to connect.
    
            --variance <variance>
                Allowed time variance in milliseconds after which check is deemed to have failed (default=1000).
    
            --verbose
                Adds more information on the execution.
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

关于红帽文档

Legal Notice

Theme

© 2026 Red Hat
返回顶部