IntroductionThis document describes how to install and configure ActiveMQ for both Unix and Windows' platforms. Document OrganizationThe Getting Started Guide for ActiveMQ contains the following sections:
Pre-Installation RequirementsHardware:
Operating Systems:
Environment:
Installation Procedure for WindowsThis section of the Getting Started Guide explains how to install binary and source distributions of ActiveMQ on a Windows system. Windows Binary InstallationThis procedure explains how to download and install the binary distribution on a Windows system.
Windows Source InstallationThis procedure explains how to download and install the source distribution on a Windows system. NOTE: ActiveMQ requires Java 7 to run and to build
The recommended method of building ActiveMQ is the following: cd [activemq_install_dir] mvn clean install where [activemq_install_dir] is the directory in which ActiveMQ was installed. If the above build fails on some tests, type the following: cd [activemq_install_dir] mvn clean install -Dmaven.test.skip=true
Warning If you are building ActiveMQ 5.x under Windows using Cygwin there is a path name length limitation. If the path name length is exceeded, you may see build errors. To correct this, move the ActiveMQ source directory higher in the file system tree, e.g., /cygdrive/c/d/sm. Windows Developer's ReleaseThis procedure explains how to download and install the latest developer's snapshot. NOTE: ActiveMQ requires Java 7 to run and to build
Installation Procedure for UnixUnix Binary InstallationThis procedure explains how to download and install the binary distribution on a Unix system.
Unix Source InstallationThis procedure explains how to download and install the source distribution on a Unix system. This procedure assumes the Unix machine has a browser. Please see the previous #Unix Binary Installation section for details on how to install ActiveMQ without a browser. NOTE: ActiveMQ requires Java 7 to run and to build
Unix Developer's ReleaseThis procedure explains how to download and install the latest developer's snapshot. NOTE: ActiveMQ requires Java 7 to run and to build
Starting ActiveMQThere now follows instructions on how to run the ActiveMQ Message Broker. On WindowsFrom a console window, change to the installation directory and run cd [activemq_install_dir] where Then type (depending on ActiveMQ version): ActiveMQ 5.10 onwards bin\activemq start ActiveMQ 5.9 or older bin\activemq NOTE: Working directories get created relative to the current directory. To create working directories in the proper place, ActiveMQ must be launched from its home/installation directory. On UnixFrom a command shell, change to the installation directory and run cd [activemq_install_dir] where bin/activemq start OR bin/activemq start > /tmp/smlog 2>&1 &; Note: /tmp/smlog may be changed to another file name. NOTE: Working directories get created relative to the current directory. To create working directories in the proper place, ActiveMQ must be launched from its home/installation directory. Warning Do NOT close the console or shell in which ActiveMQ was started, as that will terminate ActiveMQ (unless ActiveMQ was started with nohup). nohup bin/activemq > /tmp/smlog 2>&1 & More helpFor other ways of running the broker see Here. For example you can run an embedded broker inside your JMS Connection to avoid starting a separate process. Testing the InstallationIf ActiveMQ is up and running without problems, the Window's console window or the Unix command shell will display information similar to the following log line: INFO ActiveMQ JMS Message Broker (ID:apple-s-Computer.local-51222-1140729837569-0:0) has started
From a Windows console, type: netstat -an|find "61616" OR From a Unix command shell, type: netstat -an|grep 61616 Monitoring ActiveMQYou can monitor ActiveMQ using the Web Console by pointing your browser at From ActiveMQ 5.8 onwards the web apps is secured out of the box. Or you can use the JMX support to view the running state of ActiveMQ. For more information see the file Stopping ActiveMQFor both Windows and Unix installations, terminate ActiveMQ by typing "CTRL-C" in the console or command shell in which it is running. If ActiveMQ was started in the background on Unix, the process can be killed, with the following: cd [activemq_install_dir] where bin/activemq stop Or you can do the following: ps -ef|grep activemq kill [PID] where [PID] is the process id of the ActiveMQ process. Starting ActiveMQ with a different configuration fileBy default ActiveMQ uses the ActiveMQ 5.8 or olderFor example to use bin/activemq console xbean:conf/activemq-demo.xml To start Active in console mode and load the And to launch as a background process you can do: bin/activemq start xbean:conf/activemq-demo.xml ActiveMQ 5.9 onwardsFor example to use bin/activemq console xbean:examples/conf/activemq-demo.xml To start Active in console mode and load the And to launch as a background process you can do: bin/activemq start xbean:examples/conf/activemq-demo.xml Configuring ActiveMQThe ActiveMQ broker should now run. You can configure the broker by specifying an Xml Configuration file as a parameter to the activemq command. An alternative is to use the Broker Configuration URI to configure things on the command line in a concise format (though the configuration options are not as extensive as if you use Java or XML code). You can also Also see Configuring Transports to see how you can configure the various connection, transport and broker options using the connection URL in the ActiveMQConnectionFactory. See the Initial Configuration for details of which jars you need to add to your classpath to start using ActiveMQ in your Java code If you want to use JNDI to connect to your JMS provider then please view the JNDI Support. If you are a Spring user you should read about Spring Support After the installation, ActiveMQ is running with a basic configuration. For details on configuring options, please see refer to the Configuration section. Additional ResourcesIf you are new to using ActiveMQ, running the Web Samples or the Examples is a good next step to learn more about ActiveMQ. |