I am currently creating two window services:
-
ago It takes messages from an internet connection and incorporates these into a database, it is designed to be fast and stable and no other processing is done
-
Second A batch does the process with any new messages that it has gone for the last time.
I am trying to think in a way that the second service will only run its batch process when the new message is ready to be processed and if second service errors are first The service continues and vice versa. At the moment, it uses a loop every 5 seconds.
I am currently thinking of using a message queue, where the first service only writes a message, the queue is empty, and the second service will see that there is a message in the queue, if someone is in asynchronous waiting Do not go, unless a message arrives and then delete and run the message. Therefore, the use of the queue is actually not in the form of a line but in the form of a binary switch when this state changes, the event is triggered in another service.
I think there is a better way to do this, did not anyone point me in the right direction?
Actually, your path is OK How do I get these results With MSMQ, you will not need to see that there are messages written in your queue, the first service just writes in the queue, and the second service only reads it for the process (when it is active). / P>
The beauty of using MSMQ is that one or the other service may be down, but the queue is up so that you can continue the resource.
Comments
Post a Comment