0

I use Service Broker infrastructure to develop data push approach between multiple servers ( many sources and one destination ). I stick Remus Rusanu recommendations about how reuse or end conversations, for instance this one. I use an user table to store conversation handles and conversation timers to end their.

But sometimes ( not always ) I get errors when ending the conversations:

  1. This message could not be delivered because the conversation endpoint has already been closed
  2. The remote conversation endpoint is either in a state where no more messages can be exchanged, or it has been dropped.

Let's take a look two different conversation between the same services. In test purposes conversation timer is 60 seconds.

This is trace for first conversation ( without errors ):

Example without errors

I don't see any problems here.

But this is trace for the second conversation. This conversation has more messages, so the trace is longer to read, sorry about that.

Sender: Sender

Target: Target

Conversation ending timeline in the second case: TimeLine So, my questions:

  1. Why does the error occur? Sender didn't get confirming that target has acknowledged... but why sender tried to send another one message and what it tried to acknowledge? This is not an isolated case - I get these error for some conversations in our environment.
  2. Does this affect something or not? I mean, errors occur when I finish conversations and then I see proper statuses in sys.conversation_endpoints. More precisely there is no record on sender side and there is an record with "closed" status on target side after I get the error
4
  • Can you explain the message flow, particularly how you're using dialog timers? Feb 8, 2021 at 14:50
  • Sure. I'm sticking the approach Remus wrote about: rusanu.com/2007/05/03/recycling-conversations 1) when the timer is over - insert DialogTimer message to sender queue 2) delete conversation_handle from an user table ( like SessionConversations in Remus example ) and send EndOfStream message from source to target 3) end dialog on target side 4) end dialog on sender side
    – Pavel Zv
    Feb 9, 2021 at 10:52
  • oops, I've found an error in my scripts. I'm gonna return after fixing
    – Pavel Zv
    Feb 9, 2021 at 13:42
  • Let's discuss it here: dba.stackexchange.com/questions/286442/…
    – Pavel Zv
    Mar 4, 2021 at 14:54

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.