KubeMQ
Client SDKsJavaReference

Client

Client classes, builders, and lifecycle — KubeMQ Java SDK reference.

The Java SDK splits messaging APIs across focused clients: pub/sub (PubSubClient), queues (QueuesClient), and commands/queries (CQClient). All extend shared connection management and implement AutoCloseable.

Package

<dependency>
    <groupId>io.kubemq.sdk</groupId>
    <artifactId>kubemq-sdk-Java</artifactId>
    <version>3.1.1</version>
</dependency>

Requires Java 11+.

Client classes

ClassPackagePatterns
PubSubClientio.kubemq.sdk.pubsubEvents, Events Store
QueuesClientio.kubemq.sdk.queuesQueues
CQClientio.kubemq.sdk.cqCommands, Queries

Builder construction

PubSubClient pub = PubSubClient.builder()
    .address("localhost:50000")
    .clientId("java-pub")
    .build();

QueuesClient queues = QueuesClient.builder()
    .address("localhost:50000")
    .clientId("java-q")
    .build();

CQClient cq = CQClient.builder()
    .address("localhost:50000")
    .clientId("java-cq")
    .build();

Parameters (typical builder fields):

NameTypeRequiredDescription
addressStringYeshost:port for the broker
clientIdStringYesStable ID for this process
authTokenStringNoBearer token
TLS / cert fieldsvariousNoMutual TLS and trust material
reconnectionConfigReconnectionConfigNoBackoff and retry tuning

Returns: Concrete client instance ready for RPCs.

Throws: KubeMQException — validation or connection failures during build().

Lifecycle

Prefer try-with-resources because each client implements AutoCloseable:

try (PubSubClient client = PubSubClient.builder().address("localhost:50000").clientId("demo").build()) {
    // use client
}

Quick Usage

App.java
try (PubSubClient pub = PubSubClient.builder()
        .address("localhost:50000")
        .clientId("reference-demo")
        .build()) {
    // Events APIs live on PubSubClient — see Events reference page
}

See Also

Was this page helpful?

On this page