KubeMQ
Client SDKsC#Reference

Client

Construction, connect, and disposal — KubeMQ C# SDK reference.

KubeMQClient targets modern .NET with async-first APIs and IAsyncDisposable for cleanup.

Package

dotnet add package KubeMQ.SDK.CSharp

Requires .NET 8.0 (LTS).

Constructor

var client = new KubeMQClient(KubeMQClientOptions options);

Parameters:

NameTypeRequiredDescription
optionsKubeMQClientOptionsYesAddress, TLS, auth, timeouts, retry policy

ConnectAsync

await client.ConnectAsync(CancellationToken ct = default);

Establishes the gRPC connection; throws KubeMQConnectionException when the broker cannot be reached within the timeout.

DisposeAsync

await client.DisposeAsync();

Prefer await using for deterministic cleanup:

await using var client = new KubeMQClient(new KubeMQClientOptions { /* ... */ });
await client.ConnectAsync();

Quick Usage

Program.cs
await using var client = new KubeMQClient(new KubeMQClientOptions
{
    Address = "localhost:50000",
    ClientId = "csharp-demo",
});

await client.ConnectAsync();

See Also

Was this page helpful?

On this page