This repository contains source code of the RabbitMQ Java client. The client is maintained by the RabbitMQ team at Pivotal.
Maven artifacts are released to Maven Central via RabbitMQ Maven repository on Bintray. There's also a Maven repository with milestone releases. Snapshots are available as well.
This client releases are independent from RabbitMQ server releases and can be used with RabbitMQ server 3.x
.
They require Java 8 or higher.
<dependency>
<groupId>com.rabbitmq</groupId>
<artifactId>amqp-client</artifactId>
<version>5.2.0</version>
</dependency>
compile 'com.rabbitmq:amqp-client:5.2.0'
This client releases are independent from RabbitMQ server releases and can be used with RabbitMQ server 3.x
.
They require Java 6 or higher.
<dependency>
<groupId>com.rabbitmq</groupId>
<artifactId>amqp-client</artifactId>
<version>4.6.0</version>
</dependency>
compile 'com.rabbitmq:amqp-client:4.6.0'
You can experiment with the client from JShell. This requires Java 9 or more.
git clone https://github.com/rabbitmq/rabbitmq-java-client.git
cd rabbitmq-java-client
./mvnw test-compile jshell:run
...
import com.rabbitmq.client.*
ConnectionFactory cf = new ConnectionFactory()
Connection c = cf.newConnection()
...
c.close()
/exit
git clone git@github.com:rabbitmq/rabbitmq-java-client.git
cd rabbitmq-java-client
make deps
./mvnw clean package -Dmaven.test.skip -P '!setup-test-cluster'
Run the broker:
docker run -it --rm --name rabbitmq -p 5672:5672 rabbitmq:3.8
Launch "essential" tests (takes about 10 minutes):
./mvnw verify -P '!setup-test-cluster' \
-Drabbitmqctl.bin=DOCKER:rabbitmq \
-Dit.test=ClientTests,FunctionalTests,ServerTests
Launch a single test:
./mvnw verify -P '!setup-test-cluster' \
-Drabbitmqctl.bin=DOCKER:rabbitmq \
-Dit.test=DeadLetterExchange
The tests can run against a local broker as well. The rabbitmqctl.bin
system property must point to the rabbitmqctl
program:
./mvnw verify -P '!setup-test-cluster' \
-Dtest-broker.A.nodename=rabbit@$(hostname) \
-Drabbitmqctl.bin=/path/to/rabbitmqctl \
-Dit.test=ClientTests,FunctionalTests,ServerTests
To launch a single test:
./mvnw verify -P '!setup-test-cluster' \
-Dtest-broker.A.nodename=rabbit@$(hostname) \
-Drabbitmqctl.bin=/path/to/rabbitmqctl \
-Dit.test=DeadLetterExchange
See Contributing and How to Run Tests.
This package, the RabbitMQ Java client library, is triple-licensed under the Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 ("GPL") and the Apache License version 2 ("ASL").