Broker Administration Tutorials

Red Hat JBoss A-MQ

Simple recipes for managing a message broker

Red Hat

Version 6.0
13 Oct 2017

Abstract

This set of tutorials walks you through some basic management tasks.

Chapter 1. Starting a Broker

Abstract

In this tutorial you will launch a Red Hat JBoss A-MQ instance from the command line.

Goals

In this tutorial you will:
  • add the Red Hat JBoss A-MQ command line tools to your system path
  • start a JBoss A-MQ instance

Prerequisites

This tutorial requires that you have JBoss A-MQ installed.

Procedure for Windows

To start a broker on Windows:
  1. Open a command prompt at the instance's root folder.
  2. Add the JBoss A-MQ command line tools your path by entering
    c:\ set PATH=%PATH%;InstallDir\bin
  3. Start the broker instance by entering
    c:\ start

Procedure for Unix/Linux/OSX

To start a broker:
  1. Open a command prompt at the instance's root folder.
  2. Add the JBoss A-MQ command line tools your path by entering
    % set PATH=$PATH;InstallDir/bin
  3. Start the broker instance by entering
    start

Chapter 2. Installing a Broker as a Windows Service

Abstract

In this tutorial you will install a Red Hat JBoss A-MQ instance as a Windows service.

Goals

In this tutorial you will:
  • generate the service wrapper
  • configure the Java Wrapper Service for your system
  • install a broker instance as a Windows service
  • configure the broker's service to start up automatically

Prerequisites

This tutorial requires that you have Red Hat JBoss A-MQ installed on a Windows computer to which you have administrative privileges.

Procedure

To install JBoss A-MQ as a Windows service:
  1. Start JBoss A-MQ in console mode using the amq command.
  2. Once the console is started and the command prompt appears, enter features:install wrapper.
    The features:install command will locate the required libraries to provision the wrapper feature and deploy it into the run time.
  3. Generate the wrapper by entering wrapper:install -n JBossMQ -d JBossMQ -D "JBossMQ Broker".
    You should see the output shown in Example 2.1, “Wrapper Install Output”.

    Example 2.1. Wrapper Install Output

    Creating file: InstallDir\bin\FuseMQ-wrapper.exe Creating file: InstallDir\bin\JBossMQ-service.bat Creating file: InstallDir\etc\JBossMQ-wrapper.conf Creating file: InstallDir\lib\libwrapper.so Creating file: InstallDir\lib\karaf-wrapper.jar Creating file: InstallDir\lib\karaf-wrapper-main.jar Setup complete. You may wish to tweak the JVM properties in the wrapper config ration file: InstallDir\etc\JBossMQ-wrapper.conf before installing and starting the service. To install the service, run: C:> InstallDir\bin\JBossMQ-service.bat install Once installed, to start the service run: C:> net start "JBossMQ" Once running, to stop the service run: C:> net stop "JBossMQ" Once stopped, to remove the installed the service run: C:> InstallDir\bin\karaf-service.bat remove
  4. Open InstallDir\etc\JBossMQ-wrapper.conf in a text editor.
    The ServiceName-wrapper.conf file configures the Java Wrapper Service that JBoss A-MQ uses to create a Windows service.
  5. Change the line containing set.default.KARAF_HOME= to
    set.default.KARAF_HOME=InstallDir
    This tells the wrapper where the JBoss A-MQ installation is located so it can find the required libraries.
  6. Change the line containing set.default.KARAF_BASE to
    set.default.KARAF_BASE=InstallDir
    This tells the wrapper where to find the configuration and data files for the broker instance being used for the service.
  7. Change the line containing set.default.KARAF_DATA to
    set.default.KARAF_BASE=InstallDir\data
    This tells the wrapper where to find the configuration and data files for the broker instance being used for the service.
  8. Save the file.
  9. Open a command prompt.
  10. Change to the InstallDir directory.
  11. Install the broker as a Windows service by running bin\JBossMQ-service.bat install.
  12. From the Windows Start menu select StartControl PanelAdministrative ToolsServices.
    The Services window opens.
  13. Double click JBossMQ from the list of services.
    The JBossMQ Properties window opens.
  14. Specify that the service will start up when you login by selecting Automatic from the Startup Type drop-down list.
  15. Click OK.
  16. Open the context menu for the JBossMQ entry in the service list.
  17. Select Start to start the broker.

Further steps

You can stop the broker service by selecting Stop in the Service window's context menu.
To uninstall the broker as a Windows service use InstallDir\bin\JBossMQ-service.bat removes.

Chapter 3. Shutting Down a Broker

Abstract

This tutorial demonstrates how to shutdown a locally running message broker.

Goals

In this tutorial you will:
  • add the Red Hat JBoss A-MQ command line tools to your system path
  • stop a locally running JBoss A-MQ instance

Prerequisites

To complete this tutorial you will need to have a broker instance running locally.

Procedure for Windows

To shutdown a broker on Windows:
  1. Add the JBoss A-MQ command line tools your path by entering
    c:\ set PATH=%PATH%;InstallDir\bin
  2. Shutdown the broker instance by entering
    c:\ stop

Procedure for Unix/Linux/OSX

To start a broker:
  1. Add the JBoss A-MQ command line tools your path by entering
    % set PATH=$PATH;InstallDir/bin
  2. Shutdown the broker by entering
    % stop

Legal Notice

Trademark Disclaimer

The text of and illustrations in this document are licensed by Red Hat under a Creative Commons Attribution–Share Alike 3.0 Unported license ("CC-BY-SA"). An explanation of CC-BY-SA is available at http://creativecommons.org/licenses/by-sa/3.0/. In accordance with CC-BY-SA, if you distribute this document or an adaptation of it, you must provide the URL for the original version.
Red Hat, as the licensor of this document, waives the right to enforce, and agrees not to assert, Section 4d of CC-BY-SA to the fullest extent permitted by applicable law.
Red Hat, Red Hat Enterprise Linux, the Shadowman logo, JBoss, MetaMatrix, Fedora, the Infinity Logo, and RHCE are trademarks of Red Hat, Inc., registered in the United States and other countries.
Apache, ServiceMix, Camel, CXF, and ActiveMQ are trademarks of Apache Software Foundation. Any other names contained herein may be trademarks of their respective owners.

Legal Notice

Third Party Acknowledgements

One or more products in the Red Hat JBoss A-MQ release includes third party components covered by licenses that require that the following documentation notices be provided:
  • JLine (http://jline.sourceforge.net) jline:jline:jar:1.0
    License: BSD (LICENSE.txt) - Copyright (c) 2002-2006, Marc Prud'hommeaux
    All rights reserved.
    Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
    • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
    • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
    • Neither the name of JLine nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  • Stax2 API (http://woodstox.codehaus.org/StAX2) org.codehaus.woodstox:stax2-api:jar:3.1.1
    Copyright (c) <YEAR>, <OWNER> All rights reserved.
    Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
    • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
    • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  • jibx-run - JiBX runtime (http://www.jibx.org/main-reactor/jibx-run) org.jibx:jibx-run:bundle:1.2.3
    License: BSD (http://jibx.sourceforge.net/jibx-license.html) Copyright (c) 2003-2010, Dennis M. Sosnoski.
    All rights reserved.
    Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
    • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
    • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
    • Neither the name of JiBX nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  • JavaAssist (http://www.jboss.org/javassist) org.jboss.javassist:com.springsource.javassist:jar:3.9.0.GA:compile
  • HAPI-OSGI-Base Module (http://hl7api.sourceforge.net/hapi-osgi-base/) ca.uhn.hapi:hapi-osgi-base:bundle:1.2
    License: Mozilla Public License 1.1 (http://www.mozilla.org/MPL/MPL-1.1.txt)