Chapter 5. Installation

This section describes how to install HornetQ.

5.1. Prerequisites

Note

HornetQ only runs on Java 5 or later. We highly recommend to use Java 6.

By default, HornetQ server is run with 1GiB of memory. If your computer has less memory, or you want to run it with more available RAM, modify the value in bin/run.sh accordingly.

For persistence, HornetQ uses its own fast journal, which you can configure to use libaio (which is the default when running on Linux) or Java NIO. In order to use the libaio module on Linux, it's required to install libaio.

If you're not running on Linux then you don't need to worry about this.

You can install libaio using the following steps:

Using yum, (e.g. on Fedora or Red Hat Enterprise Linux):

sudo yum install libaio

Using aptitude, (e.g. on Ubuntu or Debian system):

sudo apt-get install libaio

Apache Ant is required to create the profiles for JBoss AS 5 and run the examples.

5.2. Standalone HornetQ Server

After downloading the distribution, unzip it into your chosen directory. At this point it should be possible to run straight out of the box, the following describes the directory structure:

         |-- bin
         |-- config
         | |-- jboss-as
         | `-- stand-alone 
         |-- docs
         | |-- api
         | |-- quickstart-guide
         | `-- user-manual
         |-- examples
         | |-- core
         | |-- javaee
         | `-- jms
         |-- lib
         |-- licenses
         `-- schemas
      
  • bin -- binaries and scripts needed to run JBoss Messaging

  • config -- configuration files needed to configure HornetQ. This contains configurations to run HornetQ either in stand-alone or inside JBoss AS 5. Please refer to the reference guide for details on configuration.

  • docs -- guides and javadocs for HornetQ

  • examples -- JMS and Java EE examples. Please refer to the 'running examples' chapter for details on how to run them.

  • lib -- jars and libraries needed to run HornetQ

  • licenses -- licenses for HornetQ

  • schemas -- XML Schemas used to validate HornetQ configuration files

5.3. HornetQ In JBoss AS 5

HornetQ can be deployed in JBoss AS 5. It is not shipped by default with the application server and you need to create new AS 5 profiles to run AS 5 with HornetQ.

To create AS 5 profiles:

  1. Download JBoss AS 5

  2. Set the environment property JBOSS_HOME to point to the directory where you installed JBoss AS 5

  3. run ./build.sh (or build.bat if you are on Windows) in HornetQ's config/jboss-as directory

This will create 2 new profiles in $JBOSS_HOME/server:

  • default-with-hornetq -- it corresponds to AS 5 default profile with HornetQ as its JMS provider. In this profile, HornetQ is non-clustered

  • all-with-hornetq -- it corresponds to AS 5 all profile with HornetQ as its JMS provider. In this profile, HornetQ is clustered

You can then start JBoss AS 5 using one of these profiles:

$JBOSS_HOME/bin/run.sh -c default-with-hornetq

5.4. HornetQ In JBoss AS 4

Note

HornetQ can be deployed on AS 4 but isn't recommended

As in AS 4, it is not shipped by default with the application server and you need to create new AS 4 profiles to run AS 4 with HornetQ.

To create AS 4 profiles:

  1. Download JBoss AS 4

  2. Set the environment property JBOSS_HOME to point to the directory where you installed JBoss AS 4

  3. run ./build.sh (or build.bat if you are on Windows) in HornetQ's config/jboss-as directory

This will create 2 new profiles in $JBOSS_HOME/server:

  • default-with-hornetq -- it corresponds to AS 4 default profile with HornetQ as its JMS provider. In this profile, HornetQ is non-clustered

  • all-with-hornetq -- it corresponds to AS 4 all profile with HornetQ as its JMS provider. In this profile, HornetQ is clustered

You can then start JBoss AS 4 using one of these profiles:

$JBOSS_HOME/bin/run.sh -c default-with-hornetq