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.CSharpRequires .NET 8.0 (LTS).
Constructor
var client = new KubeMQClient(KubeMQClientOptions options);Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
options | KubeMQClientOptions | Yes | Address, 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
await using var client = new KubeMQClient(new KubeMQClientOptions
{
Address = "localhost:50000",
ClientId = "csharp-demo",
});
await client.ConnectAsync();See Also
Was this page helpful?