Pergunta

I am using c#.net, the db is MS SQL 2008 R2.

I have a question that seems to have been asked a lot in the forums here. I want to use a database table as a a queue...but the processing of these messages cannot be done from the database.
I have a table that stores the requests i get from a .Net component. I now have to read the data from these tables and make http calls to 2 webservices. Based on the response received from the webservices, the data gets archived or deleted.
I had a few specific questions:
1. How do i make sure that if i pick a record for processing and the http call fails I should be able to go on to the next record, and then come back to this record at the end of the run
2. Is there an alternative to using the database as a queue(like MSMQ etc.), which option is better
3. I want to maintain an audit trail of the record status. Is creating a trigger to log the changes before the edit the best way to do it?

Regards
Leo

Foi útil?

Solução

Use Service Broker! I am using it for a while and think its great thing althought its takes time to understand how it works. Was using book to learn. Service Broker solves:

  • concurency
  • application state
  • ... many, many other things
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top