Hi All,
I am currently facing a technical problem dealing with MSMQ, C# MessageQueue and Thread.
My system is using MSMQ and C# MessageQueue framework. At the moment it will read message one by one from MSMQ and process it in C#.
There is a business scenario that the message that I am processing will be relying on another message that comes in later (say 5 minutes later). Therefore I need process this message later after the dependant message has persisted into database.
I want to put the original processing message back to the Queue with delay, retry for 10 times max with 10 seconds interval each. What is the best way for me to implement this logic given my current module is single threaded. It reads message one by one from the Queue in FIFO order.
Current Code:
var message = new System.Messaging.Message(messageBody, formatter)
_myQueue.Send(message)
I am thinking to use a ThreadPool to manage any messages requires a delay but my colleagues strongly against it as current module is single threaded and my separate thread may have adverse effect to it.
Your suggestion is greatly appreciated.
MSMQ
Hi All,
I am currently facing a technical problem dealing with MSMQ, C# MessageQueue and Thread.
My system is using MSMQ and C# MessageQueue framework. At the moment it will read message one by one from MSMQ and process it in C#.
There is a business scenario that the message that I am processing will be relying on another message that comes in later (say 5 minutes later). Therefore I need process this message later after the dependant message has persisted into database.
I want to put the original processing message back to the Queue with delay, retry for 10 times max with 10 seconds interval each. What is the best way for me to implement this logic given my current module is single threaded. It reads message one by one from the Queue in FIFO order.
Current Code:
I am thinking to use a ThreadPool to manage any messages requires a delay but my colleagues strongly against it as current module is single threaded and my separate thread may have adverse effect to it.
Your suggestion is greatly appreciated.
MSMQ