Search code examples
sql-serverservice-broker

SQL Server Service Broker message time to live


If you place a message onto a SQL service broker queue does the message have any kind of time to live value or will it just hang around forever?

I cannot seem to find anything about this. There is this post on SQL Server forums where it seems to be suggested that there is an effective timeout of 30 minutes. However, this is with message forwarding which I don't know is applicable to the above scenario.


Solution

  • It will remain on the queue. If you define a LIFETIME in the BEGIN CONVERSATION call, then broker will refuse to accept messages once that time is exceeded. I'm not sure what it does with messages on the queue it hasn't yet successfully sent once the lifetime has been passed though.