Red Hat AMQ 6
As of February 2025, Red Hat is no longer supporting Red Hat AMQ 6. If you are using AMQ 6, please upgrade: Migrating to AMQ 7.Ce contenu n'est pas disponible dans la langue sélectionnée.
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
Copier lienLien copié sur presse-papiers!
			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
Copier lienLien copié sur presse-papiers!
			This tutorial requires that you have Red Hat JBoss A-MQ installed on a Windows computer to which you have administrative privileges.
		
Procedure
Copier lienLien copié sur presse-papiers!
			To install JBoss A-MQ as a Windows service:
		
- Start JBoss A-MQ in console mode using the amq command.
- Once the console is started and the command prompt appears, enterfeatures:install wrapper.The features:install command will locate the required libraries to provision the wrapper feature and deploy it into the run time.
- Generate the wrapper by enteringwrapper: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 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 removeCopy to Clipboard Copied! Toggle word wrap Toggle overflow 
- OpenInstallDir\etc\JBossMQ-wrapper.confin a text editor.TheServiceName-wrapper.conffile configures the Java Wrapper Service that JBoss A-MQ uses to create a Windows service.
- Change the line containingset.default.KARAF_HOME=toset.default.KARAF_HOME=InstallDir set.default.KARAF_HOME=InstallDirCopy to Clipboard Copied! Toggle word wrap Toggle overflow This tells the wrapper where the JBoss A-MQ installation is located so it can find the required libraries.
- Change the line containingset.default.KARAF_BASEtoset.default.KARAF_BASE=InstallDir set.default.KARAF_BASE=InstallDirCopy to Clipboard Copied! Toggle word wrap Toggle overflow This tells the wrapper where to find the configuration and data files for the broker instance being used for the service.
- Change the line containingset.default.KARAF_DATAtoset.default.KARAF_BASE=InstallDir\data set.default.KARAF_BASE=InstallDir\dataCopy to Clipboard Copied! Toggle word wrap Toggle overflow This tells the wrapper where to find the configuration and data files for the broker instance being used for the service.
- Save the file.
- Open a command prompt.
- Change to theInstallDirdirectory.
- Install the broker as a Windows service by runningbin\JBossMQ-service.bat install.
- From the Windows menu select. The Services window opens.
- Double click JBossMQ from the list of services.The JBossMQ Properties window opens.
- Specify that the service will start up when you login by selecting Automatic from the Startup Type drop-down list.
- Click .
- Open the context menu for the entry in the service list.
- Select to start the broker.
Further steps
Copier lienLien copié sur presse-papiers!
			You can stop the broker service by selecting  in the Service window's context menu.
		
			To uninstall the broker as a Windows service use 
InstallDir\bin\JBossMQ-service.bat removes.