# rocketmq-client-dotnet **Repository Path**: ymjake/rocketmq-client-dotnet ## Basic Information - **Project Name**: rocketmq-client-dotnet - **Description**: Apache RocketMQ Client - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-11-16 - **Last Updated**: 2026-07-11 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # RocketMQ C# Client [![License](https://img.shields.io/badge/license-Apache%202-4EB1BA.svg)](https://www.apache.org/licenses/LICENSE-2.0.html) [![NuGet](https://img.shields.io/nuget/v/YMJake.RocketMQ.Client.svg)](https://www.nuget.org/packages/YMJake.RocketMQ.Client/) Enhanced C# client for Apache RocketMQ 5.x with full feature support and FIFO Consume Accelerator. ## Features - ✅ Producer — normal / FIFO / delay / transactional / recall - ✅ Simple consumer (pull mode) - ✅ Push consumer — concurrent / FIFO / **FIFO accelerator** (enhanced) - ✅ Message filtering — Tag & SQL92 expressions - ✅ Priority Message - ✅ Client properties for server-side observability / management - ⚠️ Lite Push Consumer — experimental support for RocketMQ 5.5+ - ⚠️ Lite Simple Consumer — client-side API is available, but current RocketMQ 5.5 proxy/server support is still incomplete Supports .NET 8.0 (LTS) and .NET 10.0 ## Installation ```bash dotnet add package YMJake.RocketMQ.Client ``` ### Optional: OpenTelemetry Instrumentation ```bash dotnet add package YMJake.RocketMQ.Client.OpenTelemetry ``` Automatic distributed tracing and metrics with W3C Trace Context propagation, client-side latency histograms, and broker-controlled OTLP metric export from RocketMQ settings. See [package docs](https://www.nuget.org/packages/YMJake.RocketMQ.Client.OpenTelemetry/) for details. ## Examples See [RocketMQ.Client.Samples](samples/RocketMQ.Client.Samples) for sample code. For a runnable WebAPI demo with OpenTelemetry tracing, see [RocketMQ.Client.OpenTelemetry.Sample](samples/RocketMQ.Client.OpenTelemetry.Sample). ## Client Properties You can attach opaque client properties through `ClientConfig.Builder`. These properties are reported in telemetry `Settings` and can be used by RocketMQ server-side observability and management components. ```csharp var clientConfig = new ClientConfig.Builder() .SetEndpoints("127.0.0.1:9876") .AddClientProperty("app.id", "order-service") .AddClientProperty("zone", "cn-hz-a") .Build(); var producer = await new Producer.Builder() .SetClientConfig(clientConfig) .SetTopics("OrderTopic") .Build(); ``` You can also replace, remove, or clear properties before `Build()`: ```csharp var builder = new ClientConfig.Builder() .SetEndpoints("127.0.0.1:9876") .SetClientProperties(new Dictionary { ["app.id"] = "order-service", ["zone"] = "cn-hz-a" }); builder.RemoveClientProperty("zone"); builder.ClearClientProperties(); ``` Validation rules follow the Java client design: - Up to `32` entries. - Key length up to `64` characters; value length up to `256` characters. - Key must start with a letter and only contain letters, digits, `.`, `_`, or `-`. - Key must not use the reserved `rocketmq.` prefix. - Total serialized size must not exceed `4 KB`. This configuration applies to Producer, PushConsumer, SimpleConsumer, LitePushConsumer, and LiteSimpleConsumer because they all share `ClientConfig`. ## Packages - **Main Client**: [YMJake.RocketMQ.Client](https://www.nuget.org/packages/YMJake.RocketMQ.Client/) - **OpenTelemetry**: [YMJake.RocketMQ.Client.OpenTelemetry](https://www.nuget.org/packages/YMJake.RocketMQ.Client.OpenTelemetry/) - **Repository**: [Gitee](https://gitee.com/ymjake/rocketmq-client-dotnet) ## License Apache License 2.0. Based on [Apache RocketMQ Clients](https://github.com/apache/rocketmq-clients).