How to send massive messages with any MessageQueue and .Net
In this post, I will show how to fix the overflow and implement one solution. To solve the problem, I will try to give the tools and some approaches.
When you need to send massive messages but every time you try to send it you overflow the buffer.
Probably the first approach you will think of is to divide the message.
You could divide the message into two messages, but that can bring you some problems. If you use microservices, having two messages instead of one, you will have latency and performance problems. Imagine that both messages are for the same microservice. Your microservice only takes care of the second message after processing the first one. This is only separated one message into two messages. Imagine if you have to break one message into three, four messages, it will start to be chaotic. You can have more significant problems than those.
To me, the best approach is using Redis with your Message Queue and using the Event Bus pattern.
Your message queue can be RabbitMQ or Kafka or any other you want. I chose the Event Bus pattern because it creates an abstraction so you can have any MQ…