
This section describes the process for obtaining a copy of the RabbitMQ source code, as well as instructions for building the server and the client libraries from source.
In order to build RabbitMQ, you will need a few tools. For building the server:
and for building the Java client libraries:
ant-trax.jar
(if you download ant from the above then this is included;
if you are using the ant debian package then
you also need to install the ant-optional
package).
The source code distribution is split into two main parts:
the server code and the java client library code. Both make
use of the included docs/specs directory, which
contains the machine-readable AMQP protocol specification
XML document.
The top-level Makefile contains targets all,
server, client, and
clean. all will clean and then
build everything. server and
client will invoke the respective build targets
for the server and client. clean will remove
any built targets.
The top-level Makefile also contains a bunch of other targets which are used in preparing a release - these are unlikely to be of interest.
Change to the erlang/rabbit directory, and
type make.
Other interesting Makefile targets include
/tmp/rabbit-mnesia,
but this location can be overridden by setting the
Makefile variable MNESIA_DIR:
make run MNESIA_DIR=/some/other/location/for/rabbit-mnesia
run target. See the
above description of MNESIA_DIR.
./dist, but this can be overridden by
setting the DIST_DIR variable:
make dist DIST_DIR=/some/place/to/put/a/distribution
The server startup scripts are by default placed in
$(DIST_DIR)/sbin, and this too can be
overridden, by setting SBIN_DIR:
make dist DIST_DIR=/tmp/dist/usr/lib/erlang/lib/rabbitmq_server-version \
SBIN_DIR=/tmp/dist/usr/sbin
Ensure JAVA_HOME is correctly set. Change to
the java directory, edit
config.properties.xml to fit your needs and
type ant.
Other interesting build.xml targets include
build/classes.
build/ directory,
including compiled classes, built jar files, and any
distributions placed under build/dist.
build/lib.
build/dist, containing the RabbitMQ
client jar files as well as all the libraries the AMQP
client depends on from lib. The
distribution output directory can be overridden by
setting the Ant property dist.out to a
new location:
ant -Ddist.out=/some/place/to/put/a/distribution dist