The KubeMQ SDK for Java enables Java developers to easily work with KubeMQ server.
Table of Content
General SDK description
The SDK implements all communication patterns available through the KubeMQ server:
KubeMQ-SDK-Java works with JDK 8+.
The recommended way to use the SDK for Java in your project is to consume it from Maven.
<dependency> <groupId>io.kubemq</groupId> <artifactId>kubemq-java-sdk-bom</artifactId> <version>1.0.1</version> <type>pom</type> <scope>import</scope> </dependency>
To build with Gradle, add the dependency below to your build.gradle file.
compile group: 'io.kubemq.sdk', name: 'kubemq-java-sdk', version: '1.0.1'
The only required configuration setting is the KubeMQ server address.
Configuration can be set by using one of the following:
- Environment Variable
- 'Java Property'
Configuration via Environment Variable
KubeMQServerAddress to the KubeMQ Server Address
Configuration via Java Property
by passing the -DKubeMQServerAddress= option to the JVM) Within the code
Configuration via code
When setting the KubeMQ server address within the code, simply pass the address as a parameter to the various constructors. See exactly how in the code examples in this document.
Javadoc is used for documentation. You can generate HTML locally with the following:
Running the examples
The examples are standalone projects that showcase the usage of the SDK.
To run the examples, you need to have a running instance of KubeMQ.
You can use the Gradle tasks to run the examples:
.gradlew commandQueryChannel .gradlew commandQueryInitiator .gradlew commandQueryResponder .gradlew commandQueryResponderAsync .gradlew eventChannel .gradlew eventSender .gradlew eventSubscriber
Building from source
Once you check out the code from GitHub, you can build it using Gradle.
Running the tests
To run the automated tests for this system execute: