You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 11 Next »

Installing & Using Qpid (Java)

Introduction

The information below details how to install and use the main Broker and Client packages.

Essentially, to make use of the Qpid AMQP infrastructure you need to be able to run a broker instance to handle messaging traffic and talk to your client code. Your own application code will make use of the Qpid client package provided to interface with the broker.

Prerequisites

Qpid currently requires jdk 1.5 to be available. See later section for details.

Downloading & Installing Qpid

The latest binary and source distributions of Qpid Broker and Client packages will be available here shortly.

In the meantime, please see our Build How To page.

Broker Install

Download the broker zip or tar package as appropriate for the platform you are installing on.

Once you have downloaded the package then unpack it into a directory i.e. c:/qpid

Once unpacked, the package will be installed in a directory with a release label (i.e. qpid-0.9) and the directories underneath should look something like this:

/bin

Contains various startup utilities:

qpid-server is a bash script which runs the broker on linux/unix. You should set the environment variable QPID_HOME to point at your install path e.g. C:/qpid/qpid-0.9. This enables the startup script to find default config files in the installed etc directory.

qpid-run is a script which allows shell commands to be executed which the qpid-server script utilises.

qpid-server.bat is a dos script which runs the broker on Windows. See note above about QPID_HOME.

The other scripts in this directory can be safely ignored for now.

/lib

This directory contains all the jars used by the broker, mainly in their own subdirectories.

The broker-launch.jar contains a manifest file which puts the requisite jars into the classpath for broker startup.

Other files & jars in here can be safely ignored for now.

/etc

This contains the config files used by the broker on startup.

/client

This comes with the broker package at the moment and contains the client package. The client can also be downloaded independently. See client section below for details.

/doc

Contains javadoc for the broker.

If running on a unix or linux platform check that the appropriate permissions have been applied to the .sh scripts. If not, then update i.e. chmod 755 *.sh

Client Only Install

Download the qpid-client-<build#>.zip or qpid-client-<build#>.tar.gz package as appropriate for the platform you are installing on.

Once you have downloaded the package then unpack it into a directory i.e. c:/qpid-client

Once unpacked, the package will be installed in a directory with a release label (i.e. qpid-0.9) and then under the client directory should look something like this:

/lib

This dir contains all the jars needed by the client code and the client jars themselves.

/doc

Contains javadoc for the client code.

Environment Variables

Setting JAVA environment

You can continue to use DAM packages etc for Java providing that you have the correct version current in your .softdefs.

Otherwise, you must make JDK 1.5 available by setting the JAVA_HOME and adding the bin directory it to your PATH variable.
For example, if you have installed the JDK in /home/jdk1.5 then:
JAVA_HOME should be set to /home/jdk1.5
PATH should include /home/jdk1.5/bin

To check that you have completed this change successfully, simply type

java -version

You should see something like

java version "1.5.0_07"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_07-b03)
Java HotSpot(TM) Client VM (build 1.5.0_07-b03, mixed mode, sharing)

The Qpid scripts provided will setup the classpath required for the broker to run.

Configuring Persistence

Please visit our 3rd Party Libraries page to get more information on how to set up your chosen persistence implementation for Qpid.

Running the Qpid Broker

There are scripts provided to run the broker on Windows and on Linux/Unix.

Running the Qpid Broker on Linux/Unix

First set the QPID_HOME variable to reflect the root of your installation. For example, if you have installed the broker package into a directory <homedir>/broker/qpid-xx then you should set the QPID_HOME variable to <homedir>/broker/qpid-xx.

Then run the qpid-server script from the root dir of your install.

You can also set the QPID_WORK variable in order to control the destination directory for the log dir into which broker logging is generated. For example, if you wish to set the working directory to be <homedir>/working you should set the QPID_WORK directory to be <homedir>/working.

Note that the QPID_WORK variable defaults to the current user's home directory if not set.

The config file supplied in the etc directory one level below your root dir probably doesn't need modification and is automatically picked up by the startup script.

Command Line Arguments

You can get a list of all command line arguments by using the -h argument.

In particular, -p overrides the port specified in the config file and -b overrides the bind interface (default is wildcard).

The qpid-server script also supports cygwin environments.

You can check that the broker has started up successfully by viewing the output it sends to stdout and looking for the start up port info:
2006-07-06 09:18:24,264 INFO  [main] server.Main (Main.java:181) - Starting Qpid.AMQP broker
2006-07-06 09:18:24,331 INFO  [main] server.Main (Main.java:251) - Qpid.AMQP listening on non-SSL address 0.0.0.0/0.0.0.0:5672

Running the Qpid Broker on Windows

Simply set the QPID_HOME variable and run the .bat script. All other details as identical to running on Linux/Unix.

So for example:
qpid-server.bat

Getting Help

You can view our FAQ and Troubleshooting Guide for assistance. If you can't find the information that you need there, then email our qpid users list

  • No labels