Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
DB Engine
SQL ServerMSDESQL Server CE
Services
Analysis (Data Mining)Analysis (OLAP)DTSIntegration ServicesNotification ServicesReporting Services
Programming
CLRConnectivitySQLXML
Other Technologies
ClusteringEnglish QueryFull-Text SearchReplicationService Broker
General
Data WarehousingPerformanceSecuritySetupSQL Server ToolsOther SQL Server Topics
DirectoryUser Groups
Related Topics
MS AccessOther DB ProductsMS Server Products.NET DevelopmentVB DevelopmentJava DevelopmentMore Topics ...

SQL Server Forum / Other Technologies / Service Broker / October 2008

Tip: Looking for answers? Try searching our database.

Problem with SSB ending conversations

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ronald Green - 27 Oct 2008 11:24 GMT
Hi,

I have an SSB solution deployed on a customer's sql server 2005
instance.

Messsages are sent from a service on one database (by triggers on some
tables) to a service on another database in the same instance that has
activation enabled. Both databases have TRUSTWORTHY set to ON.

Each message is sent on a new conversation, and each receive in the
target service is followed by an END CONVERSATION statement.

Now, if I query the sys.conversation_endpoints on the target database,
I see the status of all conversation_endpoints is CLOSED. On the
initiator database, all conversation_endpoints are CONVERSING.

There are no messages waiting on either queue. When I call END
CONVERSATION on the initiator side, the conversations disappear, but
they do stay on the target side - and they stay there for eternity.

I started a trace and apparently, whenever END CONVERSATION is called
on the target, a Broker:Message Undeliverable event pops up, with the
following textdata:
"This message could not be delivered because another instance of this
service program has already started conversing with this endpoint."

What went wrong??

Thanks,
R. Green
Bob Beauchemin - 28 Oct 2008 02:01 GMT
Hi Ronald,

Sounds like there may be multiple issues here:

> Now, if I query the sys.conversation_endpoints on the target database,
> I see the status of all conversation_endpoints is CLOSED. On the
> initiator database, all conversation_endpoints are CONVERSING.

That's expected, the initiator needs to respond to the END CONVERSATION
message from the target by calling END CONVERSATION on its side too. When
both sides call END CONVERSATION, then the conversation is over.

> There are no messages waiting on either queue. When I call END
> CONVERSATION on the initiator side, the conversations disappear, but
> they do stay on the target side - and they stay there for eternity.

That's expected, when both sides call END CONVERSATION, the initiator's
endpoint disappears immediate, but the target's endpoint stays around for 30
min to prevent replay attacks.

> I started a trace and apparently, whenever END CONVERSATION is called
> on the target, a Broker:Message Undeliverable event pops up, with the
> following textdata:

This is unusual, are you reusing conversation handles? You do get the
conversation handle from the message at the target? If this is SQL Server
2008, you could run ssbdiagnose to see if there are any configuration
problems.

Hope this helps,
Bob Beauchemin
SQLskills

> Hi,
>
[quoted text clipped - 26 lines]
> Thanks,
> R. Green
Roger Wolter[MSFT] - 29 Oct 2008 17:21 GMT
The issue with conversations refusing to end is generally caused by someone
trying to use a fire and forget pattern for messaging.  If you begin a
dialog, send a message, and end the conversation all in one procedure, the
conversation will end before it is established completely on the target so
it stays in a semi-established state forever.  The way to avoid this is to
not end the conversation on the initiator side but end it on the target
after the message is received and processed.  The conversation is ended on
the initiator side when the end dialog message is received form the target.

The other error is something I haven't seen before.  It sounds like you're
maybe using the same service for the initiator and target but I'm not sure.

Signature

This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

> Hi,
>
[quoted text clipped - 26 lines]
> Thanks,
> R. Green
Roger Wolter[MSFT] - 29 Oct 2008 17:29 GMT
Thanking about this a little more, it's possible that your first problem is
caused by the second problem.  If messages can't be delivered to the
initiator, the conversation can't end correctly.

Signature

This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

> The issue with conversations refusing to end is generally caused by
> someone trying to use a fire and forget pattern for messaging.  If you
[quoted text clipped - 40 lines]
>> Thanks,
>> R. Green
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.