blob: a08c454abdbbc0962e4c420ccf89df3d24a2e8d2 [file] [log] [blame]
<div class="wiki-content maincontent"><h2>Introduction</h2><p>This document describes how to install and configure ActiveMQ 4.x/5.x for both Unix and Windows' platforms.</p><h2>Document Organization</h2><p class="confluence-link">The Getting Started Guide for ActiveMQ 4.x document contains the following sections:</p><p class="confluence-link"><structured-macro ac:macro-id="83d4dda2-6235-4647-bb2f-2fdaf82efe66" ac:name="toc" ac:schema-version="1"></structured-macro></p><h2>Pre-Installation Requirements</h2><p><strong>Hardware:</strong></p><ul><li>~ 60 MB of free disk space for the ActiveMQ 5.x binary distribution.<br clear="none">(you need additional disk space for storing persistent messages to disk)</li><li>~ 300 MB of free disk space for the ActiveMQ 5.x source or developer's distributions.</li></ul><p><strong>Operating Systems:</strong></p><ul><li>Windows: Windows XP SP2, Windows 2000, Windows Vista, Windows 7.</li><li>Unix: Ubuntu Linux, Powerdog Linux, MacOS, AIX, HP-UX, Solaris, or any Unix platform that supports Java.</li></ul><p><strong>Environment:</strong></p><ul><li><a shape="rect" href="http://www.oracle.com/technetwork/java/javase/downloads/index.html">Java Runtime Environment (JRE)</a>&#160; <strong>JRE 1.7</strong> (1.6 for version &lt;=5.10.0)<br clear="none">(a JDK is required if you plan to recompile source code)</li><li>The JAVA_HOME environment variable must be set to the directory where the JRE is installed<br clear="none">(Unix: the binary "java" has to be resolvable by the PATH variable; execute "which java" to verify)</li><li><a shape="rect" href="http://maven.apache.org/">Maven</a> 3.0.0 build system<br clear="none">(only if you plan to recompile source code)</li><li><a shape="rect" href="http://cvs.apache.org/repository/geronimo-spec/jars/">JARs</a> that will be used must be added to the classpath.<br clear="none">(only if you plan to recompile source code)</li></ul><h2>Installation Procedure for Windows</h2><p>This section of the Getting Started Guide explains how to install binary and source distributions of ActiveMQ on a Windows system.</p><h4>Windows Binary Installation</h4><p>This procedure explains how to download and install the binary distribution on a Windows system.</p><ol><li>Download the latest release<br clear="none">(see&#160;<link><page ri:content-title="Download"></page></link> -&gt; "The latest stable release" -&gt; "<span class="external-link">apache-activemq-x.x.x-bin.zip</span>")</li><li>Extract the files from the ZIP file into a directory of your choice.</li><li>Proceed to the <link ac:anchor="Starting ActiveMQ"><plain-text-link-body>#Starting ActiveMQ</plain-text-link-body></link> section of this document.</li><li>Following start-up, go to the <link ac:anchor="Testing the Installation"><plain-text-link-body>#Testing the Installation</plain-text-link-body></link> section of this document.</li></ol><h4>Windows Source Installation</h4><p>This procedure explains how to download and install the source distribution on a Windows system.</p><ol><li>Download the latest release<br clear="none">(see&#160;<link><page ri:content-title="Download"></page></link> -&gt; "The latest stable release" -&gt; "<span class="external-link">apache-activemq-x.x.x-source-release.zip</span>")</li><li>Extract ActiveMQ from the ZIP file into a directory of your choice.</li><li><p><structured-macro ac:macro-id="12713513-1e78-4853-94d7-aead9600d31f" ac:name="anchor" ac:schema-version="1"><parameter ac:name="">Windows Source Installation</parameter></structured-macro><br clear="none">The recommended method of building ActiveMQ is the following:</p><structured-macro ac:macro-id="7517318b-d32d-4ffb-8d12-a0e79decca5f" ac:name="code" ac:schema-version="1"><plain-text-body>REM add "-Dmaven.test.skip=true" if tests are failing on your system (should not happen)
mvn clean install
</plain-text-body></structured-macro><p>where [activemq_install_dir] is the directory in which ActiveMQ was installed.</p></li><li><p>If you prefer to use an IDE, then you can auto-generate the IDE's project file using maven plugins:</p><structured-macro ac:macro-id="5e3e66c2-a3f9-4106-acbf-b4f0f92bbc6f" ac:name="code" ac:schema-version="1"><plain-text-body>mvn eclipse:eclipse
</plain-text-body></structured-macro><p>or</p><structured-macro ac:macro-id="ffbbf3b4-818d-49da-bff7-1f7aa7d3002e" ac:name="code" ac:schema-version="1"><plain-text-body>mvn idea:idea
</plain-text-body></structured-macro><p>Feel free to use any other applicable IDE. Please refer to the <a shape="rect" href="http://maven.apache.org/reference/plugins/plugins.html">plugin reference</a> for more details.</p></li></ol><ol><li><p>Start ActiveMQ from the target directory, for example:</p><structured-macro ac:macro-id="bad7063a-88b2-400d-a879-ee55bbb0a9cb" ac:name="code" ac:schema-version="1"><plain-text-body>cd [activemq_install_dir]\assembly\target
unzip activemq-x.x-SNAPSHOT.zip
cd activemq-x.x-SNAPSHOT
bin\activemq
</plain-text-body></structured-macro><p><strong>NOTE:</strong> Working directories get created relative to the current directory. To create the working directories in the proper place, ActiveMQ must be launched from its home/installation directory.</p></li><li><p>Proceed to the <link ac:anchor="Testing the Installation"><plain-text-link-body>#Testing the Installation</plain-text-link-body></link> section.</p><structured-macro ac:macro-id="96beee6a-1399-4d29-bb22-06d5e8ec4bd4" ac:name="warning" ac:schema-version="1"><parameter ac:name="title">Warning</parameter><rich-text-body><p>If you are building ActiveMQ 4.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.</p></rich-text-body></structured-macro></li></ol><h4>Windows Developer's Release</h4><p>This procedure explains how to download and install the latest developer's snapshot.</p><ol><li>Open the release archive: <a shape="rect" href="https://repository.apache.org/content/repositories/snapshots/org/apache/activemq/apache-activemq/">https://repository.apache.org/content/repositories/snapshots/org/apache/activemq/apache-activemq/</a><br clear="none">(open one of the SNAPSHOT directories)</li><li>Select the version of ActiveMQ to download (if necessary, scroll down to see the ActiveMQ snapshots).</li><li>Extract the files from the ZIP file into a directory of your choice.</li><li>If a binary snapshot was downloaded, proceed to the <link ac:anchor="Starting ActiveMQ"><plain-text-link-body>#Starting ActiveMQ</plain-text-link-body></link> section of this document.<br clear="none"> If a source snapshot was downloaded, perform step 6 and step 7 of the <link ac:anchor="Windows Source Installation"><plain-text-link-body>#Windows Source Installation</plain-text-link-body></link> procedure.</li><li>Following start-up, proceed to the <link ac:anchor="Testing the Installation"><plain-text-link-body>#Testing the Installation</plain-text-link-body></link> section.</li></ol><h2>Installation Procedure for Unix</h2><h4><structured-macro ac:macro-id="4f054d84-738e-410c-b571-1e89ae9dc91c" ac:name="anchor" ac:schema-version="1"><parameter ac:name="">Unix Binary Installation</parameter></structured-macro> Unix Binary Installation</h4><p>This procedure explains how to download and install the binary distribution on a Unix system.<br clear="none"> <strong>NOTE:</strong> There are several alternative ways to perform this type of installation.</p><ol><li><p>Download the activemq zipped tarball file to the Unix machine, using either a browser or a tool, i.e., wget, scp, ftp, etc. for example:<br clear="none">(see <link><page ri:content-title="Download"></page></link> -&gt; "The latest stable release")</p><structured-macro ac:macro-id="df6f9691-1cfa-476b-8f95-f2a1b5f3960a" ac:name="code" ac:schema-version="1"><plain-text-body>wget http://activemq.apache.org/path/tofile/apache-activemq-x.x.x-bin.tar.gz
</plain-text-body></structured-macro></li><li><p>Extract the files from the zipped tarball into a directory of your choice. For example:</p><structured-macro ac:macro-id="6eb21686-0107-4421-a955-e57803e67163" ac:name="code" ac:schema-version="1"><plain-text-body>cd [activemq_install_dir]
tar zxvf activemq-x.x.x-bin.tar.gz
</plain-text-body></structured-macro></li><li><p>Proceed to the <link ac:anchor="Starting ActiveMQ"><plain-text-link-body>#Starting ActiveMQ</plain-text-link-body></link> section of this document.</p></li><li>Following start-up, go to the <link ac:anchor="Testing the Installation"><plain-text-link-body>#Testing the Installation</plain-text-link-body></link> section.</li></ol><h4>Using Homebrew installer on OSX</h4><p>If you use OSX as your platform, you can use <a shape="rect" href="http://mxcl.github.com/homebrew/">Homebrew</a> package manager to easily install Apache ActiveMQ.</p><ol><li><p>After installing Homebrew package manager successfully, just run</p><structured-macro ac:macro-id="043a2c7d-bc97-4a14-83e6-5ee04057a267" ac:name="code" ac:schema-version="1"><plain-text-body>$ brew install apache-activemq
</plain-text-body></structured-macro><p>You can expect the following output:</p><structured-macro ac:macro-id="4213c84c-66dd-42d4-94ee-9e59edd230df" ac:name="code" ac:schema-version="1"><plain-text-body>==&gt; Downloading http://www.gossipcheck.com/mirrors/apache/activemq/apache-activemq/x.x.x/apache-activemq-x.x.x-bin.tar.gz
######################################################################## 100.0%
==&gt; Caveats
Software was installed to:
/usr/local/Cellar/apache-activemq/x.x.x/libexec
==&gt; Summary
/usr/local/Cellar/apache-activemq/x.x.x: 406 files, 35M, built in 2 seconds
</plain-text-body></structured-macro></li></ol><p>ActiveMQ will be installed in <code>/usr/local/Cellar/apache-activemq/x.x.x/</code> directory (where <code>x.x.x</code> denotes the actual version being installed).</p><p>Now you can proceed to <link ac:anchor="Starting ActiveMQ"><plain-text-link-body>#Starting ActiveMQ</plain-text-link-body></link> and <link ac:anchor="Testing the Installation"><plain-text-link-body>#Testing the Installation</plain-text-link-body></link> sections.</p><h4>Unix Source Installation</h4><p>This 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 <link ac:anchor="Unix Binary Installation"><plain-text-link-body>#Unix Binary Installation</plain-text-link-body></link> section for details on how to install ActiveMQ without a browser.</p><ol><li>Download the latest source release<br clear="none">(see&#160;<link><page ri:content-title="Download"></page></link> -&gt; "The latest stable release" -&gt; "<span class="external-link">activemq-parent-x.x.x-source-release.zip</span>")</li><li><p>Extract the files from the ZIP file into a directory of your choice. For example:</p><structured-macro ac:macro-id="927fbb02-22fd-4c91-a5c3-7aa9501dc756" ac:name="code" ac:schema-version="1"><plain-text-body>tar zxvf activemq.x.x-src.tar.gz
</plain-text-body></structured-macro></li><li><p>Build ActiveMQ using Maven:<br clear="none"> The preferred method of building ActiveMQ is the following:</p><structured-macro ac:macro-id="5826269a-b0d2-475b-89ce-9fe77715a810" ac:name="code" ac:schema-version="1"><plain-text-body>cd [activemq_install_dir]
mvn clean install # add "-Dmaven.test.skip=true" if tests are failing on your system (should not happen)</plain-text-body></structured-macro><p>If Maven crashes with a java.lang.OutOfMemoryError, you you need to do this first (assuming a Bourne-like shell):</p><structured-macro ac:macro-id="10e06e10-3e8d-4dfd-a58b-6a0f5c4df243" ac:name="code" ac:schema-version="1"><plain-text-body>export MAVEN_OPTS="-Xmx512M"
</plain-text-body></structured-macro><p>If you prefer to use an IDE then you can auto-generate the IDE's project file using maven plugins:</p><structured-macro ac:macro-id="837cdfc6-8605-4279-b050-9c5d5f799b99" ac:name="code" ac:schema-version="1"><plain-text-body>mvn eclipse:eclipse
</plain-text-body></structured-macro><p>or</p><structured-macro ac:macro-id="ab1ca934-28d3-4c3d-bcb8-a8b293855006" ac:name="code" ac:schema-version="1"><plain-text-body>mvn idea:idea
</plain-text-body></structured-macro><p>Feel free to use any other applicable IDE. Please refer to the <a shape="rect" href="http://maven.apache.org/reference/plugins/plugins.html">plugin reference</a> for more details.<br clear="none"> <strong>NOTE:</strong> 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.</p></li><li>Proceed to the <link ac:anchor="Starting ActiveMQ"><plain-text-link-body>#Starting ActiveMQ</plain-text-link-body></link> section of this document.</li><li>Proceed to <link ac:anchor="Testing the Installation"><plain-text-link-body>#Testing the Installation</plain-text-link-body></link> section.</li></ol><h4>Unix Developer's Release</h4><p>This procedure explains how to download and install the latest developer's snapshot.</p><ol><li>Open the release archive: <a shape="rect" href="https://repository.apache.org/content/repositories/snapshots/org/apache/activemq/apache-activemq/">https://repository.apache.org/content/repositories/snapshots/org/apache/activemq/apache-activemq/</a><br clear="none">(open one of the SNAPSHOT directories)</li><li>Select the version of ActiveMQ to download (you may have to scroll down to see the ActiveMQ snapshots). <br clear="none">The filename will be similar to: <code>activemq-x.x.x-tar.gz</code>.</li><li><p>Extract the files from the gzip file into a directory of your choice. For example:<br clear="none"> For a binary developer's snapshot:</p><structured-macro ac:macro-id="753d5cb8-9c85-451e-ad97-7e488ebe7469" ac:name="code" ac:schema-version="1"><plain-text-body>tar zxvf activemq-x.x.x.tar.gz
</plain-text-body></structured-macro><p>For a source developer's snapshot:</p><structured-macro ac:macro-id="210f3fa1-edaa-4dec-96ba-b09493a7b67b" ac:name="code" ac:schema-version="1"><plain-text-body>tar zxvf activemq-x.x.x-src.tar.gz
</plain-text-body></structured-macro></li><li><p>If a binary snapshot was downloaded, to make it executable, the <code>ActiveMQ</code> script may need its permissions changed:</p><structured-macro ac:macro-id="cb9549fd-d58b-4277-a978-4e8637b21118" ac:name="code" ac:schema-version="1"><plain-text-body>cd [activemq_install_dir]/bin
chmod 755 activemq
</plain-text-body></structured-macro></li><li>For a binary snapshot, proceed to the <link ac:anchor="Starting ActiveMQ"><plain-text-link-body>#Starting ActiveMQ</plain-text-link-body></link> section of this document.</li><li>If a source snapshot was downloaded perform steps 6 - 8 of the <link ac:anchor="Unix Source Installation"><plain-text-link-body>#Unix Source Installation</plain-text-link-body></link> procedure.</li><li>Proceed to the <link ac:anchor="Testing the Installation"><plain-text-link-body>#Testing the Installation</plain-text-link-body></link> section.</li></ol><h2><structured-macro ac:macro-id="2fd79e3b-e06e-4195-8fec-e57603deeb44" ac:name="anchor" ac:schema-version="1"><parameter ac:name="">Starting ActiveMQ</parameter></structured-macro> Starting ActiveMQ</h2><p>There now follows instructions on how to <link><page ri:content-title="Run Broker"></page><plain-text-link-body>run the ActiveMQ Message Broker</plain-text-link-body></link>.</p><h4>On Windows:</h4><p>From a console window, change to the installation directory and run <code>ActiveMQ</code>:</p><structured-macro ac:macro-id="cf300c16-c08f-461b-89a0-7843597e1d37" ac:name="code" ac:schema-version="1"><plain-text-body>cd [activemq_install_dir]
</plain-text-body></structured-macro><p>where <code>activemq_install_dir</code> is the directory in which ActiveMQ was installed, e.g., <code>c:\Program Files\ActiveMQ-5.x</code>. <br clear="none" class="atl-forced-newline"> Then type:</p><structured-macro ac:macro-id="d3c78c22-4903-4bc2-ae87-aa44b9e9d65e" ac:name="code" ac:schema-version="1"><plain-text-body>bin\activemq start
</plain-text-body></structured-macro><p><strong>NOTE:</strong> 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.</p><h4>On Unix:</h4><p>From a command shell, change to the installation directory and run <code>ActiveMQ</code> as a <strong>foregroud</strong> process:</p><structured-macro ac:macro-id="17788469-2f81-4294-addd-dba15eee852e" ac:name="code" ac:schema-version="1"><plain-text-body>cd [activemq_install_dir]/bin
./activemq console</plain-text-body></structured-macro><p>From a command shell, change to the installation directory and run <code>ActiveMQ</code> as a <strong>daemon</strong> process:</p><structured-macro ac:macro-id="233f7a71-6b58-4eb9-8185-7fa8af92a759" ac:name="code" ac:schema-version="1"><plain-text-body>cd [activemq_install_dir]/bin
./activemq start</plain-text-body></structured-macro><h3>More help</h3><p>For other ways of running the broker see <link><page ri:content-title="Run Broker"></page><plain-text-link-body>Here</plain-text-link-body></link>. For example you can run an <link><page ri:content-title="How do I embed a Broker inside a Connection"></page><plain-text-link-body>embedded broker</plain-text-link-body></link> inside your JMS Connection to avoid starting a separate process.</p><h2><structured-macro ac:macro-id="f5fd2cc6-ce2a-408e-a349-8a0a70273b0f" ac:name="anchor" ac:schema-version="1"><parameter ac:name="">Testing the Installation</parameter></structured-macro> Testing the Installation</h2><h3>Using the administrative interface</h3><ul><li>Open the administrative interface</li><li style="list-style-type: none;background-image: none;"><ul><li>URL: <a shape="rect" href="http://127.0.0.1:8161/admin/">http://127.0.0.1:8161/admin/</a></li><li>Login: admin</li><li>Passwort: admin</li></ul></li><li>Navigate to "Queues"</li><li>Add a queue name and click create</li><li>Send test message by klicking on "Send to"</li></ul><h3>Logfile and console output</h3><p>If 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:<br clear="none">(see stdout output or "[activemq_install_dir]/data/activemq.log")</p><structured-macro ac:macro-id="acba31d9-fffc-4d2f-a2d6-a8c2f84605e2" ac:name="code" ac:schema-version="1"><plain-text-body>Apache ActiveMQ 5.11.1 (localhost, ID:ntbk11111-50816-1428933306116-0:1) started | org.apache.activemq.broker.BrokerService | main
</plain-text-body></structured-macro><h3>Listen port</h3><p>ActiveMQ's default port is 61616. From another window run netstat and search for port 61616.</p><p>From a Windows console, type:</p><structured-macro ac:macro-id="45b33dc5-47a0-4333-9823-42c08431ad51" ac:name="code" ac:schema-version="1"><plain-text-body>netstat -an|find "61616"
</plain-text-body></structured-macro><p><strong>OR</strong></p><p>From a Unix command shell, type:</p><structured-macro ac:macro-id="48ad0806-4478-4942-b4cb-258f9c390733" ac:name="code" ac:schema-version="1"><plain-text-body>netstat -nl|grep 61616
</plain-text-body></structured-macro><h2>Monitoring ActiveMQ</h2><p><structured-macro ac:macro-id="0c439581-e0ce-4a78-8ac2-8f01d36f2ca6" ac:name="include" ac:schema-version="1"><parameter ac:name=""><link><page ri:content-title="Monitoring ActiveMQ"></page></link></parameter></structured-macro></p><h2>Stopping ActiveMQ</h2><p>For both Windows and Unix installations, terminate ActiveMQ by typing "CTRL-C" in the console or command shell in which it is running.</p><p>If ActiveMQ was started in the background on Unix, the process can be killed, with the following:</p><structured-macro ac:macro-id="6be78f73-6679-4ebd-9102-c0ff5ec26b6f" ac:name="code" ac:schema-version="1"><plain-text-body>cd [activemq_install_dir]/bin
./activemq stop
</plain-text-body></structured-macro><h2>Configuring ActiveMQ</h2><p>The ActiveMQ broker should now run. You can configure the broker by specifying an <link><page ri:content-title="Xml Configuration"></page></link> file as a parameter to the <em>activemq</em> command. An alternative is to use the <link><page ri:content-title="Broker Configuration URI"></page></link> 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</p><p>Also see <link><page ri:content-title="Configuring Transports"></page></link> to see how you can configure the various connection, transport and broker options using the connection URL in the ActiveMQConnectionFactory.</p><p>See the <link><page ri:content-title="Initial Configuration"></page></link> for details of which jars you need to add to your classpath to start using ActiveMQ in your Java code</p><p>If you want to use JNDI to connect to your JMS provider then please view the <link><page ri:content-title="JNDI Support"></page></link>. If you are a Spring user you should read about <link><page ri:content-title="Spring Support"></page></link></p><p>After the installation, ActiveMQ is running with a basic configuration. For details on configuring options, please see refer to the <link><page ri:content-title="Configuration"></page></link> section.</p><h2>Additional Resources</h2><p>If you are new to using ActiveMQ, running the <link><page ri:content-title="Web Samples"></page></link> or the <link><page ri:content-title="Examples"></page></link> is a good next step to learn more about ActiveMQ.</p><p>The Commercial Providers listed on the <link><page ri:content-title="Support"></page></link> page may also have additional documentation, examples, tutorials, etc... that can help you get started.</p></div>