Communication over RabbitMQ instance using EasynetQ for .NET and other platform's AMQP protocol implementations.
EasyNetQ is a very simple RabbitMQ client API avaialble for .NET focusing on the simlicity. This library simplicity is achieved through their own naming convention. Which means all the queue, exchange names, bindings, etc. all are handled by the library. When comes to .NET microservices this library is very simple to use, when all the .NET projects are shared common library for EventBus message formats. But when comes to different projects with not shared common message format library or communicating with different AMQP libraries, such as .NET Core 3 to Node.js or .NET Core 3 to .NET Framework MVC, I've come accoross that this default convention is not usable considering below reasons.
- Queue naming covention - Since easynetq provide it's own queue name based the message "Class name, Namespace", it's hard to specify exact queue name when communicate with another AMQP protocol library. Ex: .NET Core + EasyNetQ -> Node.JS + amqplib.
- Serialization & Deserialization - EasynetQ use fully qualified assembly name during serialization and deserialization of messages. This is problematic when sending messages from another AMQP protocol library to EasyNeqQ library. Ex: Node + Amqplib to .NET + EasynetQ.
This repository mainly for the usage of EasyNetQ libraries concerning given considerations. This repository covers below communication patterns of EasyNetQ library.
- Send/Receive pattern
- RPC (Remote Procedure Call) pattern
- Run
docker-compose up -d --buil
to run the RabbitMQ instance configured with 2 queues astest.communication.queue
- for Send/Receive example andpayment.validity.check.queue
for RPC example. - Build Node.js project using
npm install
command on the root of the project folder namedNode
- Send/Receive style projects - You can find configuration file named
EventBusTypeNameSerializer.cs
file which override default full qualified assembly name convention. Examples to try:- .NET Core to .NET Core - Run
DotnetCore.Receiver
andDotnetCore.Sender
projects - .NET Core to Node.Js - Run
NodeJS/sendreceive_receiver.js
andDotnetCore.Sender
projects - Node.Js to .NET Core - Run
DotnetCore.Receiver
andNodeJS/sendreceive_sender.js
projects
- .NET Core to .NET Core - Run
- RPC style projects - You can find configuration file named
EventBusTypeNameSerializer.cs
file which override default full qualified assembly name convention andEventBusConventions.cs
file which use theQueueAttribute
queue name instead of default queue name convention.- .NET Core to .NET Core - Run
DotnetCore.Rpc.Responder
andDotnetCore.Rpc.Requester
projects - .NET Core to Node.Js - Run
NodeJS/rpc_responder.js
andDotnetCore.Rpc.Requester
projects
- .NET Core to .NET Core - Run
- .NET EasyNetQ to RabbitMQ Java Client communication
- .NET EasyNetQ to RabbitMQ Python Client communication