简体   繁体   中英

Conversations in Sql Server Service Broker

As I understand it, a Conversation will be delivered in order to one session.

But what if I have a session that gets all the messages for a conversation, then, while they are being processed, a few more are added.

The session finishes and sends an End Conversation, but there are more in the queue so the initiator does not send the End Conversation.

The session that got the first messages is done/gone/no more. What will Service Broker do with the other messages? Do they time out and then go to another session?

Does it wait for the end conversation from the session that has the first messages? (If not how does it guarantee the correct order?)

Or (worst case) are those messages never processed?

I tired to figure this myself by just observing, but the results are ambiguous enough that I would like an answer from someone who knows.

When an EndDialog message is dispatched, Service Broker ensures all the pending messages in the queue are sent ahead of the EndDialog. No more messages can be sent on that conversation, but messages can still be processed at the destination.

At the receiving end the processor should continue to look for messages until it sees the EndDialog message - once it sees that it can close the conversation at its end, since it knows there can be no more messages for that conversation.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM