This repository provides the official Java client library as well as examples of how applications can interact with BlazingMQ. BlazingMQ is an open source message queue system with focus on efficiency, reliability and a rich feature set. Please see the BlazingMQ repo and documentation for more details about BlazingMQ.
This Java client is fully supported by the BlazingMQ team and we provide feature and/or API parity with the BlazingMQ C++ client library.
This repository contains two modules. The built packages for these modules are available in Maven Central:
- bmq-sdk: contains BlazingMQ Java client library code
- bmq-examples: contains sample producer and consumer clients
Execute from repo root:
$ mvn clean install
Above command will compile and install both modules -- bmq-sdk
as well as
bmq-examples
. It will also run tests and carry out static analysis. If it
is desired to skip running any tests and static analysis while creating the
JARs (because those steps were executed already), one can execute:
$ mvn clean -Dmaven.test.skip=true -Dspotbugs.skip=true install
$ cd bmq-examples
$ mvn clean compile
$ mvn exec:java -Dexec.mainClass="com.bloomberg.bmq.examples.Producer"
Above command expects that bmq-sdk
JAR is installed locally. Also note that
BlazingMQ backend must be running for producer/consumer examples to run
successfully.
Detailed instructions to build BlazingMQ backend (BlazingMQ message brokers, etc) can be found here.
The SDK code supports building with the following kits:
- JDK8
- Builds the code with these compiler parameters:
source=8
(which allows up to Java 8 features)target=8
(which generates JVM 8 bytecode)
- Builds the code with these compiler parameters:
- JDK11 and JDK17
- Builds the code with
release=8
(generated JVM 8 compatible code) plus builds the code injava9
directory withrelease=9
. This way multi release JAR is produced which contains Java8 and Java9 versions ofCrc32c
class
- Builds the code with
By default, JDK defined in JAVA_HOME
is used. When running any maven
command, corresponding profile is activated depending on the JDK version. To
get a list of active profiles run the following command:
# On this machine JAVA_HOME is set to JDK8.
$ mvn help:active-profiles
...
The following profiles are active:
- JDK8 (source: com.bloomberg.bmq:bmq-sdk:X.Y.Z-SNAPSHOT)
To use another JDK, override JAVA_HOME
env variable. For instance:
# clean output and compile the code using JDK 11
$ JAVA_HOME=${PATH_TO_JDK11} mvn clean compile
...
[INFO] BUILD SUCCESS
...
-
All unit tests
$ mvn -q -Dspotbugs.skip=true -Dspotless.check.skip=true test // '-q' for quiet mode
-
A specific unit test class, e.g.
OpenQueueTest
$ mvn -q -Dspotbugs.skip=true -Dspotless.check.skip=true -Dtest=OpenQueueTest test
-
A specific unit test method of a class, e.g.
OpenQueueTest.testReset
$ mvn -q -Dspotbugs.skip=true -Dspotless.check.skip=true -Dtest=OpenQueueTest#testReset test
We welcome your contributions to help us improve and extend this project!
We welcome issue reports here; be sure to choose the proper issue template for your issue, so that we can be sure you're providing us with the necessary information.
Before sending a Pull Request, please make sure you have read our Contribution Guidelines.
The BlazingMQ Java SDK is Apache 2.0 licensed, as found in the LICENSE file.
This project has adopted a Code of Conduct. If you have any concerns about the Code, or behavior which you have experienced in the project, please contact us at opensource@bloomberg.net.
If you believe you have identified a security vulnerability in this project, please send an email to the project team at opensource@bloomberg.net, detailing the suspected issue and any methods you've found to reproduce it.
Please do NOT open an issue in the GitHub repository, as we'd prefer to keep vulnerability reports private until we've had an opportunity to review and address them.