Question

I am trying to figure out how to deal with errors using Sql Server Service Broker.

I have read that there is no real "poison message" control in the Service Bus other than to just stop processing.

For my system, this would be very bad (we would get quite behind on messages).

I have seen an example that says it deals with this by using end conversation with error <error code>

But I can't seem to find out what this actually does in the queues or where the error is recorded.

If anyone knows what calling a "with error" on end conversation does, I would love to hear it.

Was it helpful?

Solution

It places an Error message on to the queue rather than an EndDialog message. Books online states 'Service Broker drops any other messages for this conversation currently in the transmission queue.' which I take to mean that this message replaces any messages that haven't yet been sent.

The error number and message get placed in the message body.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top