On Windows platforms brokers are run as either foreground processes or as system services. You can shutdown running brokers using operating system actions. For example, typing CTRL+C in a window in which a foreground broker is running will shutdown the broker. Closing the window will also shutdown a foreground broker.
However, if you want to properly shutdown a broker use the administration tool's stop task. It ensures that the broker is gracefully shutdown. It also allows you to shutdown brokers remotely.
On Windows, the command to shutdown a broker is activemq-admin stop. The syntax for the command is shown in Example 4.1.
Example 4.1. Syntax for Stopping a Broker on Windows
activemq-admin stop
{[brokerName
] | [--all]} [--jmxurl JMXUrl
] [-jmxuser userName
] [-jmxpassword password
]
![]() | Tip |
---|---|
For a full description of the parameters see activemq-admin 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.
The command shown in Example 4.2 shuts down a broker
named gatewayEast
that is running in the default JMX context.
The command shown in Example 4.3 shuts down all of the brokers running in the default JMX context.
The command shown in Example 4.4 shuts down a broker
named gatewayEast
that is running in the JMX context
service:jmx:rmi:///jndi/rmi://localhost:8050/jmxrmi
.
Example 4.4. Shutting Down a Broker on Windows in a Non-default JMX Context
c:\
activemq-admin stop gatewayEast --jmxurl service:jmx:rmi:///jndi/rmi://localhost:8050/jmxrmi