This repository contains source code of the RabbitMQ Java client. The client is maintained by the RabbitMQ team at Broadcom.
This client releases are independent of 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.21.0</version>
</dependency>
<dependency>
<groupId>com.rabbitmq</groupId>
<artifactId>amqp-client</artifactId>
<version>5.22.0-SNAPSHOT</version>
</dependency>
Snapshots are available on the Sonatype OSS snapshot repository:
<repositories>
<repository>
<id>ossrh</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
<releases>
<enabled>false</enabled>
</releases>
</repository>
</repositories>
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 [email protected]:rabbitmq/rabbitmq-java-client.git
cd rabbitmq-java-client
make deps
Run the broker:
docker run -it --rm --name rabbitmq -p 5672:5672 rabbitmq
Launch "essential" tests (takes about 10 minutes):
./mvnw verify \
-Drabbitmqctl.bin=DOCKER:rabbitmq \
-Dit.test=ClientTestSuite,FunctionalTestSuite,ServerTestSuite
Launch a single test:
./mvnw verify \
-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 \
-Dtest-broker.A.nodename=rabbit@$(hostname) \
-Drabbitmqctl.bin=/path/to/rabbitmqctl \
-Dit.test=ClientTestSuite,FunctionalTestSuite,ServerTestSuite
To launch a single test:
./mvnw verify \
-Dtest-broker.A.nodename=rabbit@$(hostname) \
-Drabbitmqctl.bin=/path/to/rabbitmqctl \
-Dit.test=DeadLetterExchange
See Contributing and How to Run Tests.
This library uses semantic versioning.
See the RabbitMQ Java libraries support page for the support timeline of this library.
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 ("AL").
This means that the user can consider the library to be licensed under any of the licenses from the list above. For example, you may choose the Apache Public License 2.0 and include this client into a commercial product. Projects that are licensed under the GPLv2 may choose GPLv2, and so on.