Here is the .NET implementation of the client for Apache RocketMQ.
Due to the release of .NET 5 in 2020, which unified .NET Framework and .NET Core, and has gradually become the mainstream platform for .NET development, the RocketMQ client will support .NET 5 and later versions.
See more details about .NET 5 from Introducing .NET 5.
The client would be developed using the protocols outlined in rocketmq-apis and built on gRPC-dotnet, leveraging Protocol Buffers for data serialization and deserialization during transmission.
dotnet add package RocketMQ.Client
You can obtain the latest version of RocketMQ.Client
from NuGet Gallery. To assist with getting started quickly and working with various message types and clients, we offer examples here.
Layout of this project roughly follows this guide . The solution contains a class library, a unit test module and an example console module. Assuming you are at the home of this repository:
# build the project dotnet build # run unit tests dotnet test -l "console;verbosity=detailed"
We use NLog as our logging implementation. Similar to the Java binding, we allow the use of environment variables to customize the related configuration:
rocketmq.log.level
: Log output level, default is INFO.rocketmq.log.root
: The root directory of the log output. The default path is $HOME/logs/rocketmq
, so the full path is $HOME/logs/rocketmq/rocketmq-client.log
.rocketmq.log.file.maxIndex
: The maximum number of log files to keep. The default is 10, and the size of a single log file is limited to 64 MB. Adjustment is not supported yet.Specifically, by setting mq.consoleAppender.enabled
to true, you can output client logs to the console simultaneously if you need debugging.
dotnet pack --configuration Release
command. This will create a NuGet package in the bin/Release
folder of the project.bin/Release
folder.