Drop Table

Support Forum for database administrators and web based access to important newsgroups related to databases
Register on Database Support Forum Edit your profileCalendarFind other Database Support forum membersFrequently Asked QuestionsSearch this forum -> 
For Database admins: Free Database-related Magazines Now Free shipping to Texas


Post New Thread










Thread
Author

conversation handle
hi all, i am having a hard time getting the conversation handle id to match 
..

scripts that create the relevant objects ...

create message type QueryMessage validation = none
create contract QueryContract (QueryMessage sent by initiator)
create queue QueueSender
create queue QueueReceiver
create service Sender on queue QueueSender
create service Receiver on queue QueueReceiver (QueryContract)

send with conversation handle id ...

begin transaction
declare @conversationhandle uniqueidentifier;
select @conversationhandle = 'd27db2ac-08c5-405d-a53e-ec05635c7e5a'
begin dialog @conversationhandle
from service [Sender]
to service 'Receiver'
on contract [QueryContract]
with encryption = off;
send on conversation @conversationhandle
message type [QueryMessage] ('blah blah blah;');
commit transaction

after i ran the above send query a few times, and do the below select ...

select  conversation_group_i
d,  conversation_handle,
 cast(message_body as
varchar(1000)) from QueueReceiver

i got all kinds of different  conversation_group_i
d and conversation_handle?
should one of them be d27db2ac-08c5-405d-a53e-ec05635c7e5a which i specified
in the send query??

and when i do the below receive query, it says:
Msg 8426, Level 16, State 20, Line 1
The conversation handle "D27DB2AC-08C5-405D-A53E-EC05635C7E5A" is not found.

receive top(1)  convert(varchar(1000
),message_body) as message
from QueueReceiver
where conversation_handle = 'd27db2ac-08c5-405d-a53e-ec05635c7e5a'

please help!  thanks in advance!

- tin


Report this thread to moderator Post Follow-up to this message
Old Post
tin
03-01-06 01:23 AM


Re: conversation handle
The conversation handle is an output parameter for the BEGIN DIALOG
statement. Each time you run the statement, a new conversation will be
created and the @conversationhandle will get a new value assigned to it. If
the variable had a previous value, it will be overwriten.

So the conversation with the handle 'd27db2ac-08c5-405d-a53e-ec05635c7e5a'
was never created, hence the error on the RECEIVE statement.

--
This posting is provided "AS IS" with no warranties, and confers no rights.

HTH,
~ Remus Rusanu

SQL Service Broker
http://msdn2.microsoft.com/en-us/library/ms166043(en-US,SQL.90).aspx


"tin" <tin@discussions.microsoft.com> wrote in message
news:0DC24D17-0167-4D80-8072- 97817B6C7ABB@microso
ft.com...
> hi all, i am having a hard time getting the conversation handle id to
> match ...
>
> scripts that create the relevant objects ...
>
> create message type QueryMessage validation = none
> create contract QueryContract (QueryMessage sent by initiator)
> create queue QueueSender
> create queue QueueReceiver
> create service Sender on queue QueueSender
> create service Receiver on queue QueueReceiver (QueryContract)
>
> send with conversation handle id ...
>
> begin transaction
> declare @conversationhandle uniqueidentifier;
> select @conversationhandle = 'd27db2ac-08c5-405d-a53e-ec05635c7e5a'
> begin dialog @conversationhandle
> from service [Sender]
> to service 'Receiver'
> on contract [QueryContract]
> with encryption = off;
> send on conversation @conversationhandle
> message type [QueryMessage] ('blah blah blah;');
> commit transaction
>
> after i ran the above send query a few times, and do the below select ...
>
> select  conversation_group_i
d,  conversation_handle,
 cast(message_body as
> varchar(1000)) from QueueReceiver
>
> i got all kinds of different  conversation_group_i
d and
> conversation_handle?
> should one of them be d27db2ac-08c5-405d-a53e-ec05635c7e5a which i
> specified
> in the send query??
>
> and when i do the below receive query, it says:
> Msg 8426, Level 16, State 20, Line 1
> The conversation handle "D27DB2AC-08C5-405D-A53E-EC05635C7E5A" is not
> found.
>
> receive top(1)  convert(varchar(1000
),message_body) as message
> from QueueReceiver
> where conversation_handle = 'd27db2ac-08c5-405d-a53e-ec05635c7e5a'
>
> please help!  thanks in advance!
>
> - tin
>



Report this thread to moderator Post Follow-up to this message
Old Post
Remus Rusanu [MSFT]
03-01-06 01:23 AM


Re: conversation handle
ah, no wonder.  another question:

if i want an application to send messages to 2 applications, then i guess i
will have to create two queues?  i was trying to use one queue with 2
conversation handles.

many thanks.

"Remus Rusanu [MSFT]" wrote:

> The conversation handle is an output parameter for the BEGIN DIALOG
> statement. Each time you run the statement, a new conversation will be
> created and the @conversationhandle will get a new value assigned to it. I
f
> the variable had a previous value, it will be overwriten.
>
> So the conversation with the handle 'd27db2ac-08c5-405d-a53e-ec05635c7e5a'
> was never created, hence the error on the RECEIVE statement.
>
> --
> This posting is provided "AS IS" with no warranties, and confers no rights
.
>
> HTH,
> ~ Remus Rusanu
>
> SQL Service Broker
> http://msdn2.microsoft.com/en-us/library/ms166043(en-US,SQL.90).aspx
>
>
> "tin" <tin@discussions.microsoft.com> wrote in message
> news:0DC24D17-0167-4D80-8072- 97817B6C7ABB@microso
ft.com... 
>
>
>

Report this thread to moderator Post Follow-up to this message
Old Post
tin
03-01-06 01:23 AM


Re: conversation handle
In general yes, each application should listen on it's own queue. When
sending a message to more than one application it usually conforms to a
publish-subscribe pattern. See if this article helps you at
http://blogs.msdn.com/remusrusanu/a.../12/502942.aspx

--
This posting is provided "AS IS" with no warranties, and confers no rights.

HTH,
~ Remus Rusanu

SQL Service Broker
http://msdn2.microsoft.com/en-us/library/ms166043(en-US,SQL.90).aspx


"tin" <tin@discussions.microsoft.com> wrote in message
news:F9E9BD78-2518-4360-A0C1- 6B02A62DFF10@microso
ft.com...
> ah, no wonder.  another question:
>
> if i want an application to send messages to 2 applications, then i guess
> i
> will have to create two queues?  i was trying to use one queue with 2
> conversation handles.
>
> many thanks.
>
> "Remus Rusanu [MSFT]" wrote:
> 



Report this thread to moderator Post Follow-up to this message
Old Post
Remus Rusanu [MSFT]
03-01-06 01:23 AM


Re: conversation handle
thanks, that helped a lot!

"Remus Rusanu [MSFT]" wrote:

> In general yes, each application should listen on it's own queue. When
> sending a message to more than one application it usually conforms to a
> publish-subscribe pattern. See if this article helps you at
> http://blogs.msdn.com/remusrusanu/a.../12/502942.aspx
>
> --
> This posting is provided "AS IS" with no warranties, and confers no rights
.
>
> HTH,
> ~ Remus Rusanu
>
> SQL Service Broker
> http://msdn2.microsoft.com/en-us/library/ms166043(en-US,SQL.90).aspx
>
>
> "tin" <tin@discussions.microsoft.com> wrote in message
> news:F9E9BD78-2518-4360-A0C1- 6B02A62DFF10@microso
ft.com... 
>
>
>

Report this thread to moderator Post Follow-up to this message
Old Post
tin
03-01-06 01:23 AM


Sponsored Links





Last Thread Next Thread
Post New Thread

MS SQL Server archive

Show a Printable Version Email This Page to Someone! Receive updates to this thread
Microsoft SQL Server
Access database support
PostgreSQL Replication
SQL Server ODBC
FoxPro Support
PostgreSQL pgAdmin
SQL Server Clustering
MySQL ODBC
Web Applications with dBASE
SQL Server CE
MySQL++
Sybase Database Support
MS SQL Full Text Search
PostgreSQL Administration
SQL Anywhere support
DB2 UDB Database
Paradox Database Support
Filemaker Database
Berkley DB
SQL 2000/2000i database
ASE Database
Forum Jump:
All times are GMT. The time now is 09:53 AM.

 
Mobile devices forum | Database support forum archive




Copyrights DropTable.com Database Support Forum 2004 - 2006