This week I was informed of the presence of Service Broker within SQL Server. I need to build an Agent Server to create asynchronous messaging capabilities for a Client/Server application I am the architect / application developer for. I have some basic
questions bridging the vision I have already in mind, and seeking the correct Service Broker term / capability to map each to. I have worked with several SQL based message queue implementations in the past.
1) May a SQL update a message?
I was intending on creating a "status" column in my queue table. Messages when created (SQL INSERT) would have a value of "new" for the status column. When the Agent Server wakes up to process requests in category "xyz" it does a SELECT for "[status] = 'new'". During the course of working on the request, the request might not be completable. In that case, the "status" column would get changed - let's say to 'error'. Thus subsequent SELECT SQL statements would no longer detect the same message.
Failed messages would simply stay in the queue for traceability. Some sort of purge process would remove messages older than n-days.
This brings me to the next question...
2) How to select for view the message queue?
Is there some way to SELECT for display all of the messages in the queue, no matter what type of message? I envision for the admin interface to the Agent Server, this being an important tool to leave in the client admin's hands.
3) What to do with unable to be completed messages?
Like I already hinted at... what happens if a message in the queue is not able to be completed for some reason? With Service Broker must the "bad" message be removed from the queue to not get reprocessed?
I think answers to these questions will provide a good start to furthering my investigation of Service Broker. Thank you!
Sincerely,
Michael Lueck
Lueck Data Systems
http://www.lueckdatasystems.com/