c# - multi-threading based RabbitMQ consumer -
We have a window service that listens to the same rabbit MQ queue and processes the message.
We would like to extend the same window services so that it can listen to many quotes of RabbitMQ and process the message.
Using multi-threading, it can not be ensured that each thread has to be queued (blocking).
As I am very new to multi-threading, I need high level guidelines at the bottom point, which will help me start building prototype.
- Is it possible to hear many queues in a single application using threading?
- How to handle such a situation where a single thread was sown (due to exception etc.), how to get the entire window back without restart services.
- Any such design pattern or open source implementation which can help me handle such a situation.
I like how you wrote your question - it started very broad and special I have successfully implemented something very equally, and currently working on an open-source project so that my lessons can be learned and able to return to the community. Unfortunately, though- I have not prepared my code neatly to package, which does not help you much! However, to answer your questions:
1 Is it possible to use threading for many queues?
A: Yes, but it can be full of loss, namely, the rabbit MQ. The NET Library is not the best written piece of the code, and I found it to be a relatively lenient implementation of the AMQP protocol, one of the most deadly warnings is how to handle "receiving" or "consumer" behavior, which is careful If not, the deadlock can cause a lot easier. Fortunately, this is well illustrated in the API documentation. Advice - If you can, then use a single connection object then, in each thread, use a new IModel
and connection to create a related user Please.
2. How to handle exceptions in threads
- I believe this is another topic and I will not tell it here because you can use it in many ways.
3 Any open source projects?
- I like the rear thinking, although I have finished my own rolling. I hope that when my open source project has been completed it will have to come back, because I think it is better than EasyNetQ.
Comments
Post a Comment