The administration tool's stop task uses JMX to locate and shutdown brokers on Unix and Unix-like platforms. This saves you from remembering a broker's PID each time it starts up.
The Unix stop task can also be configured to force a shutdown if an orderly shutdown hangs. It does this by waiting a predetermined amount of time and then killing the broker process.
On Windows, the command to shutdown a broker is activemq stop. The syntax for the command is shown in Example 4.5.
Example 4.5. Syntax for Stopping a Broker on Unix/Linux/OS X
activemq stop
{[brokerName
] | [--all]} [--jmxurl JMXUrl
] [-jmxuser userName
] [-jmxpassword password
]
![]() | Tip |
---|---|
For a full description of the parameters see activemq stop. |
If you do not use the --jmxurl
parameter, the default JMX url,
service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi
, is used. This is the JMX url
specified in the default Fuse Message Broker configuration.
If you configured a broker to use a different JMX url, you must use the
--jmxurl
parameter and provide the JMX url for connecting to
the broker.
If you have secured JMX access to the broker, you will need to use the
-jmxuser
and -jmxpassword
parameters. They
specify the user name and password required to access the broker's JMX context. For
information about using security with JMX see
JMX Security in Fuse Message Broker Security Guide.
When you execute the stop task, the administration tool initiates an
orderly shutdown of the broker (or brokers) by sending a shutdown request to the JMX port.
If the broker fails to shut down within a specified timeout, the administration tool sends
a SIGKILL
signal to the broker process.
The duration of the kill timeout is set by the ACTIVEMQ_KILL_MAXSECONDS
environment variable. For more information about setting up your environment for the
administration tool see Setting up the Unix/Linux/OS X Environment.
The command shown in Example 4.6 shuts down a broker
named gatewayEast
that is running in the default JMX context.
The command shown in Example 4.7 shuts down all of the brokers running in the default JMX context.
The command shown in Example 4.8 shuts down a broker
named gatewayEast
that is running in the JMX context
service:jmx:rmi:///jndi/rmi://localhost:8050/jmxrmi
.
Example 4.8. Shutting Down a Broker in a Non-default JMX Context on Unix/Linux/OS X
>
activemq stop gatewayEast --jmxurl service:jmx:rmi:///jndi/rmi://localhost:8050/jmxrmi