Administering a Message Broker

Version 4.4.1

Sept. 2011
Trademark Disclaimer
Third Party Acknowledgements

Updated: 06 Jun 2013

Table of Contents

1. Setting up the Administration Tool
Setting up the Windows Environment
Setting up the Unix/Linux/OS X Environment
2. Installing Fuse Message Broker as a Windows Service
Configuring the Wrapper
Installing the Windows Service
3. Starting a Broker
Specifying the Broker's Configuration
Starting a Broker on Windows
Starting a Broker on Unix/Linux/OS X
Starting a Broker with Maven
4. Shutting Down a Broker
Shutting Down a Broker on Windows
Shutting Down a Broker on Unix/Linux/OS X
A. Administration Tool Commands
activemq-admin create — creates a new instance of the broker's file structure
activemq — starts a foreground broker on Windows
activemq start — starts a daemon broker on Unix
activemq console — starts a foreground broker on Unix
activemq stop — shuts down a running broker on Unix
activemq restart — restarts a running broker on Unix
activemq-admin stop — shuts down a running broker on Windows
activemq-admin list — lists the available brokers
activemq-admin query — queries the broker for information on specific objects
activemq-admin bstat — summarizes the statistics for a broker
activemq-admin browse — browse the contents of a destination
activemq-admin journal-audit — audits the log files of the persistent journal
activemq-admin purge — purges messages from a destination
B. Broker Properties
Index

List of Tables

1.1. Windows Administration Tool Environment Variables
1.2. Unix Administration Tool Environment Variables
3.1. Maven Configuration Properties
B.1. Broker URI Properties
B.2. Property File Properties

List of Examples

1.1. Sample Windows Environment Script
2.1. Default Environment Settings
2.2. Default Java System Properties
2.3. Default Wrapper Application Settings
2.4. Default Wrapper Classpath
3.1. Broker URI Syntax
3.2. Broker URI
3.3. Broker Properties File
3.4. Syntax for Starting a Broker on Windows
3.5. Syntax for Starting a Daemon Broker on Unix
3.6. Syntax for Starting a Foreground Broker on Unix
3.7. Using the Maven Plug-in from the Command Line
3.8. Using the Maven Plug-in from a POM
4.1. Syntax for Stopping a Broker on Windows
4.2. Shutting Down a Broker on Windows
4.3. Shutting Down All Broker on Windows
4.4. Shutting Down a Broker on Windows in a Non-default JMX Context
4.5. Syntax for Stopping a Broker on Unix/Linux/OS X
4.6. Shutting Down a Broker on Unix/Linux/OS X
4.7. Shutting Down All Broker on Unix/Linux/OS X
4.8. Shutting Down a Broker in a Non-default JMX Context on Unix/Linux/OS X

Fuse Message Broker uses a wrapper, based on the Java service wrapper from Tanuki Software Ltd., that provides a solution to the problem of launching a Java application as a Windows service. The wrapper provides a mechanism for specifying all of the required JVM and application specific parameters to the Windows' service interface.

The wrapper is located in the bin/win32 folder of a Windows Fuse Message Broker installation. This folder contains the following:

  • activemq.bat—script that starts the broker in the foreground

  • InstallService.bat—script that installs the broker as a Windows service

  • UninstallService.bat—script that uninstalls the broker from the service registry

  • wrapper.conf—file that configures the wrapper service

  • wrapper.dll

  • wrapper.exe—wrapper service executable

Before using the wrapper to install Fuse Message Broker as a Windows service, you will want to check the wrappers configuration to ensure it is set up properly.

There are three ways to pass configuration to a broker instance at start-up:

  • XBean URI—specifies the location a Spring XML configuration file

  • Broker URI—specifies the broker configuration as part of the URI

  • Properties URI—specifies the location of properties file containing Fuse Message Broker configuration

You can specify a broker's configuration entirely on the command line using a broker URI of the form shown in Example 3.1.


For example, the URI shown in Example 3.2 starts up a broker that accepts connections on port 61616, establishes a network connection to remotehost:61616, and disables persistence.


If the basic broker provided by adding the plug-in on the command line is insufficient for test an application the plug-in can be included in the project's POM. When included in a POM, the Fuse Message Broker plug-in uses a configuration URI to configure the broker. The plug-in can also set system properties when starting the broker.

Table 3.1 describes the configuration properties used by the Fuse Message Broker Maven plug-in.


To start the configured broker when running the project use mvn activemq:run.

Example 3.8 shows a POM fragment that configures the Fuse Message Broker plug-in to start a broker using the activemq.xml configuration file on the project's class path.

Example 3.8. Using the Maven Plug-in from a POM

<project ... >

  ...

  <repositories>
  <!-- FuseSource maven repositories -->
    <repository>
      <id>fusesource.releases</id>
      <name>FuseSoure releases repository</name>
      <url>http://repo.fusesource.com/maven2/</url>
      <releases>
        <enabled>true</enabled>
      </releases>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
    </repository>
    <repository>
      <id>fusesource.snapshots</id>
      <name>FuseSource Snapshot Repository</name>
      <url>http://repo.fusesource.com/maven2-snapshot</url>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
      <releases>
        <enabled>false</enabled>
      </releases>
    </repository>
  </repositories>

  <pluginRepositories>
  <!-- FuseSource maven repositories -->
    <pluginRepository>
      <id>fusesource.releases</id>
      <name>FuseSoure releases repository</name>
      <url>http://repo.fusesource.com/maven2/</url>
      <releases>
        <enabled>true</enabled>
      </releases>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
    </pluginRepository>
    <pluginRepository>
      <id>fusesource.snapshots</id>
      <name>FuseSource Snapshot Repository</name>
      <url>http://repo.fusesource.com/maven2-snapshot</url>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
      <releases>
        <enabled>false</enabled>
      </releases>
    </pluginRepository>
  </pluginRepositories>

  ...

  <build>    
    <plugins>
      <plugin>
        <groupId>org.apache.activemq.tooling</groupId>
        <artifactId>maven-activemq-plugin</artifactId>
        <version>5.5</version>
        <configuration>
          <configUri>xbean:activemq.xml</configUri>
          <fork>false</fork>
        </configuration>
        <dependencies>
          <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring</artifactId>
            <version>2.5.5</version>
          </dependency>
          <dependency>
            <groupId>org.mortbay.jetty</groupId>
            <artifactId>jetty-xbean</artifactId>
            <version>6.1.11</version>
          </dependency> 	
          <dependency>
            <groupId>org.apache.camel</groupId>
            <artifactId>camel-activemq</artifactId>
            <version>1.1.0</version>
          </dependency>
        </dependencies>			
      </plugin>
    </plugins>
  </build>
</project>

Important

The administration tool requires that brokers have JMX enabled. By default, JMX is enabled.

activemq-admin create — creates a new instance of the broker's file structure
activemq — starts a foreground broker on Windows
activemq start — starts a daemon broker on Unix
activemq console — starts a foreground broker on Unix
activemq stop — shuts down a running broker on Unix
activemq restart — restarts a running broker on Unix
activemq-admin stop — shuts down a running broker on Windows
activemq-admin list — lists the available brokers
activemq-admin query — queries the broker for information on specific objects
activemq-admin bstat — summarizes the statistics for a broker
activemq-admin browse — browse the contents of a destination
activemq-admin journal-audit — audits the log files of the persistent journal
activemq-admin purge — purges messages from a destination

C

configuration
broker uri, Broker URI
properties file, Property configuration
xbean, XBean configuration
configuration uri
broker, Broker URI
properties, Property configuration
xbean, XBean configuration
configUri, Using the POM

F

forced shutdown, Shutdown timeout
fork, Using the POM

K

kill timeout, Shutdown timeout

M

maven-activemq-plugin
command line, Using the command line
in a POM, Using the POM

P

properties uri, Property configuration

S

SSL_OPTS, Environment variables
systemProperties, Using the POM