Hi:
My service broker was working perfectly fine earlier. As I was testing...I recreated the whole service broker once again.
Now I am able to get the message at the server end from intiator. When trying to send message from my server to the intiator it gives this error in sql profiler.
broker:message undeliverable: This message could not be delivered because the Conversation ID cannot be associated with an active conversation. The message origin is: 'Transport'.
broker:message undeliverable This message could not be delivered because the 'receive sequenced message' action cannot be performed in the 'ERROR' state.
How do I proceed now ?
Thanks,
Pramod
This is happening randomly....
Now When I am sending the message I am getting this error in intiator sql profiler.
broker:message undeliverable: This message could not be delivered because the Conversation ID cannot be associated with an active conversation. The message origin is: 'Transport'....
What does this mean ?
Thanks,
Pramod
|||Did you backup, move and restore the initiator database? The error you are seeing could be produced because the initiator endpoint and the target endpoint are not in sync which could be the result of a backup/restore operation. If it is possible, can you drop all services and start all over on the two instances?|||I meant "did you backup, move and restore the TARGET database"|||In fact I created new databases, new services, new endpoints on both sides i.e on both instances.
Pramod
|||The problem is from the END CONVERSATION ... WITH CLEANUP. Don't use it, use simple END CONVERSATION. See this http://blogs.msdn.com/remusrusanu/archive/2006/01/27/518455.aspx
HTH,
~ Remus
Remus:
I removed with cleanup in my sprocs...I notice other interesting things happening.
The error still comes up in the SQL profiler, but the message is delivered randomly.If I try sending 3 times 1 time it reachs target service broker.
One more interesting thing is my xml message which I sent is garbled in the target. Its not the way I sent to target from initiator.
Thanks,
Pramod
|||Pramod S Kumar wrote:
...the message is delivered randomly.If I try sending 3 times 1 time it reachs target service broker.
Typically this means that there are more instances of the target service and Service Broker does a load balancing across them. Make sure you don't have the same target service in another database you forgot about. Alternatively you can specify the desired broker instance in the BEGIN DIALOG to force the selected target service.
Also, see this post here http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=335683&SiteID=1
Pramod S Kumar wrote:
One more interesting thing is my xml message which I sent is garbled in the target. Its not the way I sent to target from initiator.
Can you give an example of how the payload is garbled?
Please note that Unicode XML has a Byte Order Mark (BOM) like 0xFFFE in front of the XML stream. Also, make sure you don't mix VARCHAR and NVARCHAR types when sending/receiving the message. The best practice is to always use the XML datatype for this. If the SEND payload is declared in the T-SQL batch, declare it as XML. If is a parameter sent from Ado.NET, use the System.Data.SqlDbType.Xml parameter type. Same applies to receiving the message, assign the message_body to a XML type.
HTH,
~ Remus
Remus:
Prblm 1:
--
I am forcing to target service name here...Hence that should not be problem.
DECLARE @.dialog_handle uniqueidentifier,
@.msg XML
BEGIN DIALOG CONVERSATION @.dialog_handle
FROM SERVICE CLIENTSERVICE
TO SERVICE 'SERVERSERVICE'
ON CONTRACT MainContract
WITH ENCRYPTION = OFF ;
Prblm 2:
--
This works fine b/w 2 instances in local server but doesnt work b/w 2 different servers.
Here is my table structure for both target and initiator.
CREATE TABLE [dbo].[messages_log](
[logid] [int] IDENTITY(1,1) NOT NULL,
[logdata] [varchar](max) COLLATE Latin1_General_CI_AI NULL,
[msgdata] [xml] NULL,
CONSTRAINT [PK_messages_log] PRIMARY KEY CLUSTERED
(
[logid] ASC
) ON [PRIMARY]
) ON [PRIMARY]
GO
Thanks,
Pramod
|||
Pramod S Kumar wrote:
Remus:
Prblm 1:
--
I am forcing to target service name here...Hence that should not be problem.DECLARE @.dialog_handle uniqueidentifier,
@.msg XML
BEGIN DIALOG CONVERSATION @.dialog_handle
FROM SERVICE CLIENTSERVICE
TO SERVICE 'SERVERSERVICE'
ON CONTRACT MainContract
WITH ENCRYPTION = OFF ;
I think you missed my point. Unless you specify a broker instance, the load balancing is probably the problem. Your script does not specify a broker instance.
Pramod S Kumar wrote:
Prblm 2:
--
This works fine b/w 2 instances in local server but doesnt work b/w 2 different servers.Here is my table structure for both target and initiator.
CREATE TABLE [dbo].[messages_log](
[logid] [int] IDENTITY(1,1) NOT NULL,
[logdata] [varchar](max) COLLATE Latin1_General_CI_AI NULL,
[msgdata] [xml] NULL,
CONSTRAINT [PK_messages_log] PRIMARY KEY CLUSTERED
(
[logid] ASC
) ON [PRIMARY]
) ON [PRIMARY]GO
This doesn't help me in any way. I'm asking you to show me an example of how the actual XML message is different between the one you SEND and the one you RECEIVE.
|||Remus:
Ok you meant to specify broker instance while specifying route...if that is the case here is the script..
Initiator:
CREATE ROUTE SERVERROUTE
WITH
BROKER_INSTANCE = '3F070C35-3C1E-4FA7-B654-33280DA1482B',
SERVICE_NAME = 'SERVERSERVICE' ,
ADDRESS = 'tcp://10.23.2.145:6099';
Target:
CREATE ROUTE CLIENTROUTE
WITH
BROKER_INSTANCE = '4FB2019E-D9D0-4665-9FF6-262D5C33A3D5',
SERVICE_NAME = 'CLIENTSERVICE' ,
ADDRESS = 'tcp://10.23.2.146:6022';
GO
Ok with xml....here is the example...
Original XML
<queue userid="23" Friendlyname="more download" TemplateName="TempDownloadReportName">
<filters columnkey="VDATE8" datatype="0">
<criteria leftarg="3/26/2005 12:00:00 AM" logop="0" rightarg="4/1/2005 12:00:00 AM">
<fields field="YRMTH" datatype="2" grouporder="-1" summed="0" averaged="0" counted="1" />
<fields field="SLINE" datatype="2" grouporder="1" summed="0" averaged="0" counted="0" />
<fields field="VESSEL" datatype="2" grouporder="2" summed="0" averaged="0" counted="0" />
<fields field="COMMODITY" datatype="2" grouporder="3" summed="0" averaged="0" counted="0" />
<fields field="REEFER" datatype="3" grouporder="4" summed="0" averaged="0" counted="0" />
</criteria>
</filters> </queue>
XML received at target:
<queue userid="23" Friendlyname="more download" TemplateName="TempDownloadReportName">
<filters columnkey="VDATE8" datatype="0">
<criteria leftarg="3/26/2005 12:00:00 AM" logop="0" rightarg="4/1/2005 12:00:00 AM">
<fields field="YRMTH" datatype="2" grouporder="-1" summed="0" averaged="0" counted="1" />
</criteria>
</filters>
<filters columnkey="VDATE8" datatype="0">
<criteria leftarg="3/26/2005 12:00:00 AM" logop="0" rightarg="4/1/2005 12:00:00 AM">
<fields field="SLINE" datatype="2" grouporder="1" summed="0" averaged="0" counted="0" />
</criteria>
</filters>
<filters columnkey="VDATE8" datatype="0">
<criteria leftarg="3/26/2005 12:00:00 AM" logop="0" rightarg="4/1/2005 12:00:00 AM">
<fields field="VESSEL" datatype="2" grouporder="2" summed="0" averaged="0" counted="0" />
</criteria>
</filters>
<filters columnkey="VDATE8" datatype="0">
<criteria leftarg="3/26/2005 12:00:00 AM" logop="0" rightarg="4/1/2005 12:00:00 AM">
<fields field="COMMODITY" datatype="2" grouporder="3" summed="0" averaged="0" counted="0" />
</criteria>
</filters>
<filters columnkey="VDATE8" datatype="0">
<criteria leftarg="3/26/2005 12:00:00 AM" logop="0" rightarg="4/1/2005 12:00:00 AM">
<fields field="REEFER" datatype="3" grouporder="4" summed="0" averaged="0" counted="0" />
</criteria>
</filters>
</queue>
Now...when I tried today...I am not able to send any messages from target to initiator.I have also enabled message forwarding.
Thanks,
Pramod
|||Pramod S Kumar wrote:
Remus:
Ok you meant to specify broker instance while specifying route...
Sorry about the confusion. I actually meant specifying the broker instance in the BEGIN DIALOG statement, like this:
BEGIN DIALOG CONVERSATION @.dialog_handle
FROM SERVICE CLIENTSERVICE
TO SERVICE 'SERVERSERVICE', '3F070C35-3C1E-4FA7-B654-33280DA1482B'
ON CONTRACT MainContract
WITH ENCRYPTION = OFF ;
Pramod S Kumar wrote:
Ok with xml....here is the example...
Original XML
<queue userid="23" Friendlyname="more download" TemplateName="TempDownloadReportName">
<filters columnkey="VDATE8" datatype="0">
<criteria leftarg="3/26/2005 12:00:00 AM" logop="0" rightarg="4/1/2005 12:00:00 AM">
<fields field="YRMTH" datatype="2" grouporder="-1" summed="0" averaged="0" counted="1" />
<fields field="SLINE" datatype="2" grouporder="1" summed="0" averaged="0" counted="0" />
<fields field="VESSEL" datatype="2" grouporder="2" summed="0" averaged="0" counted="0" />
<fields field="COMMODITY" datatype="2" grouporder="3" summed="0" averaged="0" counted="0" />
<fields field="REEFER" datatype="3" grouporder="4" summed="0" averaged="0" counted="0" />
</criteria>
</filters> </queue>
XML received at target:
<queue userid="23" Friendlyname="more download" TemplateName="TempDownloadReportName">
<filters columnkey="VDATE8" datatype="0">
<criteria leftarg="3/26/2005 12:00:00 AM" logop="0" rightarg="4/1/2005 12:00:00 AM">
<fields field="YRMTH" datatype="2" grouporder="-1" summed="0" averaged="0" counted="1" />
</criteria>
</filters>
<filters columnkey="VDATE8" datatype="0"><criteria leftarg="3/26/2005 12:00:00 AM" logop="0" rightarg="4/1/2005 12:00:00 AM">
<fields field="SLINE" datatype="2" grouporder="1" summed="0" averaged="0" counted="0" />
</criteria>
</filters>
<filters columnkey="VDATE8" datatype="0"><criteria leftarg="3/26/2005 12:00:00 AM" logop="0" rightarg="4/1/2005 12:00:00 AM">
<fields field="VESSEL" datatype="2" grouporder="2" summed="0" averaged="0" counted="0" />
</criteria></filters>
<filters columnkey="VDATE8" datatype="0"><criteria leftarg="3/26/2005 12:00:00 AM" logop="0" rightarg="4/1/2005 12:00:00 AM">
<fields field="COMMODITY" datatype="2" grouporder="3" summed="0" averaged="0" counted="0" />
</criteria>
</filters>
<filters columnkey="VDATE8" datatype="0"><criteria leftarg="3/26/2005 12:00:00 AM" logop="0" rightarg="4/1/2005 12:00:00 AM">
<fields field="REEFER" datatype="3" grouporder="4" summed="0" averaged="0" counted="0" />
</criteria>
</filters>
</queue>
These are not differences from Service Broker, but either from your processing or from the XML column storage in the table. If you would compare the XML in the queue itself (the one returned by RECEIVE), you'd see it identically with the one sent.
Note that XML data is not a string, you may have different representations of the same XML fragment that are equivalent.
|||Remus:
I did make all the changes u specified.
Today I am not able to send any message when I send a message...I still have same error...in SQL Profiler.
This message could not be delivered because the Conversation ID cannot be associated with an active conversation. The message origin is: 'Transport'.
Thanks,
Pramod
|||This means that you still have a conversation that is sending messages to it's peer conversation endpoint that was ended WITH CLEANUP.
Cleanup all databases involved (use ALTER DATABASE ... SET NEW_BROKER) and make sure that there are no more END CONVERSATION ... WITH CLEANUP in your scripts.
HTH,
~ Remus
No comments:
Post a Comment