This repository contains implementations of various RabbitMQ exchange types, demonstrating different message routing patterns. The project includes both C# and Node.js implementations for different exchange types.
Exchange Type | Node.js Producer | Node.js Consumer | C# Producer | C# Consumer |
---|---|---|---|---|
Direct Exchange | Producer | Consumer | Producer | Consumer |
Fanout Exchange | Producer | Consumer | Producer | Consumer |
Topic Exchange | Producer | Consumer | Producer | Consumer |
Headers Exchange | Producer | Consumer | Producer | Consumer |
Dead Letter Exchange | Producer | Consumer | Producer | Consumer |
Alternate Exchange | Producer | Consumer | Producer | Consumer |
The project is organized into two main directories:
- Located in the
c-sharp
directory - Contains implementations of different RabbitMQ exchange types in C#
- Located in the
nodejs
directory - Contains implementations of different RabbitMQ exchange types in Node.js
The project demonstrates several RabbitMQ exchange types:
-
Direct Exchange
- Routes messages to queues based on exact matching of the routing key
-
Fanout Exchange
- Broadcasts messages to all bound queues regardless of the routing key
-
Topic Exchange
- Routes messages based on pattern matching of the routing key
-
Headers Exchange
- Routes messages based on message headers rather than routing keys
-
Dead Letter Exchange
- Routes messages to a dead letter queue when they cannot be delivered to the intended queue
-
Alternate Exchange
- Routes messages to an alternate exchange when they cannot be delivered to the intended exchange
- Cloud RabbitMQ server
- Node.js (for Node.js implementations)
- .NET SDK (for C# implementations)
Each exchange type implementation contains both producer and consumer components. The specific setup and running instructions can be found in each implementation directory.
- Uses the
amqplib
package for RabbitMQ communication - Each exchange type has its own producer and consumer implementation
- Configuration is handled through environment variables
- Uses the RabbitMQ .NET client library
- Implements different exchange types with proper error handling
- Includes examples of message publishing and consuming
Feel free to submit issues and enhancement requests!
This project is licensed under the terms of the MIT license.