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 Start Control Panel Administrative Tools Services.
    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.
Red Hat logoGithubRedditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2024 Red Hat, Inc.