...
The Getting Started Guide for ActiveMQ 4.x document contains the following sections:
Pre-Installation Requirements
Hardware:
- 33 ~ 60 MB of free disk space for the ActiveMQ 45.x binary distribution.
200 (you need additional disk space for storing persistent messages to disk)
- ~ 300 MB of free disk space for the ActiveMQ 45.x source or developer's distributions.
...
- Windows: Windows XP SP2, Windows 2000, Windows Vista, Windows 7.
- Unix: Ubuntu Linux, Powerdog Linux, MacOS, AIX, HP-UX, Solaris, or any Unix platform that supports Java.
Environment:
- Java Developer Kit (JDK) JDK JDK 1.7 (1.6 for version <=5.10.0)
- The JAVA_HOME environment variable must be set to the directory where the JDK is installed
(Unix: the binary "java" have to be resolvable by the PATH variable, execute "which java" to verify)
- Maven 3.0.0 build system
(only for development purposes)
- JARs that will be used must be added to the classpath.
(only for enhanced configuration)
Installation Procedure for Windows
...
This procedure explains how to download and install the binary distribution on a Windows system.
- From a browser, navigate to activemq.apache.org/.
- Click the #Download link in the navigation pane (the left pane).
- Click the #ActiveMQ 4.x Release link under the "Latest Releases" section. This brings up a new page.
- Under the #Download Here section, select the desired distribution (you may have to scroll down to see the "Download Here" section).
For a binary distribution, the filename will be similar to: Download the latest release
(see Download -> "The latest stable release" -> "apache-activemq-x.x.x-bin.zip.")
- Extract the files from the ZIP file into a directory of your choice.
- Proceed to the #Starting ActiveMQ section of this document.
- Following start-up, go to the #Testing the Installation section of this document.
...
This procedure explains how to download and install the source distribution on a Windows system.
NOTE: ActiveMQ can be run on a Java 1.4.x system, however, Java 1.5 is required to compile/build ActiveMQ.
- From a browser, navigate to activemq.apache.org/.
- Click the #Download link in the navigation pane (the left pane).
- Click the #ActiveMQ 4.x Release link under the "Latest Releases" section. This brings up another page.
- Under the #Download Here section, select the desired distribution (if necessary, scroll down to see the "Download Here" section).
For a source distribution, the filename will be similar to: Download the latest release
(see Download -> "The latest stable release" -> "apache-activemq-x.x.x-srcsource-release.zip.")
- Extract ActiveMQ from the ZIP file into a directory of your choice.
-
Anker |
|
Windows Source Installation |
|
Build ActiveMQ using Maven 2.0.4 or greater and Java 1.5.
The recommended method of building ActiveMQ is the following:
Codeblock |
...
-
REM add '-Dmaven.test.skip=true' if tests are failing on your system (should not happen)
mvn clean install
|
where [activemq_install_dir] is the directory in which ActiveMQ was installed.
-
If
...
Codeblock |
cd [activemq_install_dir]
mvn clean install -Dmaven.test.skip=true
|
-
If you prefer to use an IDE, then you can auto-generate the IDE's project file using maven plugins:
Codeblock |
mvn eclipse:eclipse
|
or
Codeblock |
mvn idea:idea
|
Feel free to use any other applicable IDE. Please refer to the plugin reference for more details.
-
Start ActiveMQ from the target directory, for example:
Codeblock |
cd [activemq_install_dir]\assembly\target
unzip activemq-x.x-SNAPSHOT.zip
cd activemq-x.x-SNAPSHOT
bin\activemq
|
NOTE: 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.
-
Proceed to the #Testing the Installation section.
Warnung |
|
|
| 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. |
Windows Developer's Release
This procedure explains how to download and install the latest developer's snapshot.
NOTE: ActiveMQ can be run on a Java 1.4.x system, however, Java 1.5 is required to compile/build ActiveMQ.
- From a browser, navigate to activemq.apache.org/.
- Click the #Download link in the navigation pane (the left pane).
- Click the #Current development SNAPSHOT release link.
- Open the release archive: https://repository.apache.org/content/repositories/snapshots/org/apache/activemq/apache-activemq/
(open one of the SNAPSHOT directories)
- Select the version of ActiveMQ to download (if necessary, scroll down to see the ActiveMQ snapshots).
- Extract the files from the ZIP file into a directory of your choice.
- If a binary snapshot was downloaded, proceed to the #Starting ActiveMQ section of this document.
If a source snapshot was downloaded, perform step 6 and step 7 of the #Windows Source Installation procedure.
- Following start-up, proceed to the #Testing the Installation section.
Installation Procedure for Unix
...
This procedure explains how to download and install the binary distribution on a Unix system.
NOTE: There are several alternative ways to perform this type of installation.
-
Download the activemq gzip zipped tarball file to the Unix machine, using either a browser or a tool, i.e., wget, scp, ftp, etc. for example:
(see Download -> "The latest stable release")
Codeblock |
> wget http://activemq.apache.org/path/tofile/apache-activemq-4x.1x.0x-incubatorbin.tar.gz
|
-
Extract the files from the gzip file zipped tarball into a directory of your choice. For example:
Codeblock |
> cd [activemq_install_dir]
tar zxvf activemq-x.x.x-bin.tar.gz
|
-
If the ActiveMQ start-up script is not executable, change its permissions. The ActiveMQ script is located in the bin directory. For example:
Codeblock |
> cd [activemq_install_dir]/bin
> chmod 755 activemq
|
-
Proceed to the #Starting ActiveMQ section of this document.
- Following start-up, go to the #Testing the Installation section.
Using Homebrew installer on OSX
If you use OSX as your platform, you can use Homebrew package manager to easily install Apache ActiveMQ.
-
After installing Homebrew package manager successfully, just run
Codeblock |
$ brew install apache-activemq
|
You can expect the following output:
Codeblock |
==> Downloading http://www.gossipcheck.com/mirrors/apache/activemq/apache-activemq/x.x.x/apache-activemq-x.x.x-bin.tar.gz
######################################################################## 100.0%
==> Caveats
Software was installed to:
/usr/local/Cellar/apache-activemq/x.x.x/libexec
==> Summary
/usr/local/Cellar/apache-activemq/x.x.x: 406 files, 35M, built in 2 seconds
|
ActiveMQ will be installed in /usr/local/Cellar/apache-activemq/x.x.x/ directory (where x.x.x denotes the actual version being installed).
Now you can proceed to #Starting ActiveMQ and #Testing the Installation sections.
Unix Source Installation
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 #Unix Binary Installation section for details on how to install ActiveMQ without a browser.
NOTE: ActiveMQ can be run on a Java 1.4.x system, however, Java 1.5 is required to compile/build ActiveMQ.
- From a browser, navigate to activemq.apache.org/.
- Click the #Download link in the navigation pane (the left pane).
- Click the #ActiveMQ 4.x Release link under the "Latest Releases" section. This brings up a new page.
- Under the #Download Here section, select the desired distribution (if necessary, scroll down to see the "Download Here" section).
For a source distribution, the filename will be similar to: activemq-x.x-src.tar.gz.Download the latest source release
(see Download -> "The latest stable release" -> "activemq-parent-x.x.x-source-release.zip")
-
Extract the files from the ZIP file into a directory of your choice. For example:
Codeblock |
tar zxvf activemq.x.x-src.tar.gz
|
-
Build ActiveMQ using Maven 2.0.4 or greater and Java 5:
The preferred method of building ActiveMQ is the following:
Codeblock |
cd [activemq_install_dir]
mvn clean install # add '-Dmaven.test.skip=true' if tests are failing on your system (should not happen)
|
If Maven crashes with a java.lang.OutOfMemoryError, you you need to do this first (assuming a Bourne-like shell):
Codeblock |
export MAVEN_OPTS="-Xmx512M"
|
If the above build fails on some tests, do the following:
Codeblock |
cd [activemq_install_dir]
mvn clean install -Dmaven.test.skip=true
|
If you prefer to use an IDE then you can auto-generate the IDE's project file using maven plugins:
Codeblock |
mvn eclipse:eclipse
|
or
Codeblock |
mvn idea:idea
|
Feel free to use any other applicable IDE. Please refer to the plugin reference for more details.
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.
- Proceed to the #Starting ActiveMQ section of this document.
- Proceed to #Testing the Installation section.
Unix Developer's Release
This procedure explains how to download and install the latest developer's snapshot.
NOTE: ActiveMQ can be run on a Java 1.4.x system, however, Java 5 is required to compile/build ActiveMQ.
- From a browser, navigate to activemq.apache.org/.
- Click the #Download link in the navigation pane (the left pane).
- Click the #Current development SNAPSHOT release link.
- Open the release archive: https://repository.apache.org/content/repositories/snapshots/org/apache/activemq/apache-activemq/
(open one of the SNAPSHOT directories)
- Select the version of ActiveMQ to download (you may have to scroll down to see the ActiveMQ snapshots).
The filename will be similar to: activemq-x.x.x-tar.gz or activemq-x.x.x-src.tar.gz.
-
Extract the files from the gzip file into a directory of your choice. For example:
For a binary developer's snapshot:
Codeblock |
tar zxvf activemq-x.x.x.tar.gz
|
For a source developer's snapshot:
Codeblock |
tar zxvf activemq-x.x.x-src.tar.gz
|
-
If a binary snapshot was downloaded, to make it executable, the ActiveMQ script may need its permissions changed:
Codeblock |
cd [activemq_install_dir]/bin
chmod 755 activemq
|
- For a binary snapshot, proceed to the #Starting ActiveMQ section of this document.
- If a source snapshot was downloaded perform steps 6 - 8 of the #Unix Source Installation procedure.
- Proceed to the #Testing the Installation section.
Anker |
|
|
Starting ActiveMQ
...
where activemq_install_dir is the directory in which ActiveMQ was installed, e.g., c:\Program Files\ActiveMQ-45.x.
Then type:
Codeblock |
bin\activemq
|
...
From a command shell, change to the installation directory and run ActiveMQ as a foregroud process:
Codeblock |
cd [activemq_install_dir]
|
...
...
Codeblock |
bin/activemq
OR
bin/activemq > /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.
nohup bin/activemq > /tmp/smlog 2>&1 &
./activemq console
Warnung |
|
|
| Do NOT close the console or shell in which ActiveMQ was started, as that will terminate ActiveMQ (unless ActiveMQ was started with nohup). |
Codeblock |
From a command shell, change to the installation directory and run ActiveMQ as a daemon process:
Codeblock |
cd [activemq_install_dir]/bin
./activemq start
|
More help
For 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.
Anker |
|
|
Testing the Installation
Using the administrative interface
- Open the administrative interface
-
- Navigate to "Queues"
- Add a queue name and click create
- Send test message by klicking on "Send to"
Logfile and console output
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:
(see stdout output or "[activemq_install_dir]/data/activemq.log")
Codeblock |
INFOApache ActiveMQ JMS Message Broker (ID:apple-s-Computer.local-51222-1140729837569-0:0) has started
5.11.1 (localhost, ID:ntbk11111-50816-1428933306116-0:1) started | org.apache.activemq.broker.BrokerService | main
|
Listen port
ActiveMQ's default port is 61616. From another window run netstat and search for port 61616.
...
From a Unix command shell, type:
Codeblock |
netstat -annl|grep 61616
|
Monitoring ActiveMQ
...
If ActiveMQ was started in the background on Unix, the process can be killed, with the following:
Codeblock |
ps -ef|grep activemq
kill [PID]
where [PID] is the process id of the ActiveMQ process.
cd [activemq_install_dir]/bin
./activemq stop
|
Configuring ActiveMQ
The 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
...