I have a windows service that listens to a message queue and processes request from this message queue. I have an initial application that places messages in the message queue. The service itself actually creates some files on the fly and when these files are created I need the initial application to grab these files and essentially paint them on the screen. (the files are an html format) For the time being I have the application and the service running on my local machine so the files are just located on the c: drive of my machine.
My issue is that I need some way to signal my initial application that the service has picked up and processed my msg successfully or unsuccessfully. I have been researching how to do this and have come up empty handed. I have also been brainstorming ideas as to what I could do to make this work. One non viable solution was to insert a record into a database table when sending a msg to the queue and upon processing finished within the service update the queue record, all the while having the application query the table checking for a status of processing complete. I don’t like this idea at all as I feel like it would be too intensive, and I believe that there has to be a better way of doing this. I am going to continue to research how this can be done, but I am definitely hoping someone has a better solution to this than my sql query running over and over again. Note in the past I have tried to query the event viewer for processes, and I know how to do this, but this will take far too long for the timing I am looking to accomplish.
I ended up going with the route of inserting record into database prior to call windows service. Then when the windows service finished with its process it updated this db record. All the while my page is calling a webservice via javascript which checks the db to see if the flag on the record has been set to done processing. This allows me to determine when the windows service has finished processing my msg from the queue.