Hi all,In my attempt to implement a simple conversation using Borker service in SQL Server 2008, I've successfully executed the following code:-- set up:USE master;GOALTER DATABASE AdventureWorks2008R2 SET ENABLE_BROKER;GOUSE AdventureWorks2008R2;GOCREATE MASTER KEY ENCRYPTION BY PASSWORD = 'dyfnds65;sdf%h457!;'GOCREATE Message Type AWNewNotice VALIDATION = NONE; CREATE Message Type AWAck VALIDATION = NONE; CREATE CONTRACT NewNoticeContract (AWNewNotice SENT BY ANY, AWAck SENT BY ANY );CREATE QUEUE AWNewNoticeQueue; CREATE QUEUE AWAckQueue; CREATE SERVICE AWNewNoticeService ON QUEUE AWNewNoticeQueue; CREATE SERVICE AWAckService ON QUEUE AWAckQueue (NewNoticeContract);-- send message:DECLARE @dialog_handle uniqueidentifier, @XMLdata XML; SET @XMLdata = (SELECT * FROM sys.tables FOR XML AUTO); BEGIN DIALOG @dialog_handle FROM SERVICE AWNewNoticeService TO SERVICE 'AWAckService' ON CONTRACT NewNoticeContract;SEND ON CONVERSATION @dialog_handle MESSAGE TYPE AWNewNotice(@XMLdata);
Yet, when I want to receive the message using the following code, I don't find any message to receive.-- receive:SELECT * FROM AWNewNoticeQueue; DECLARE @dialog_handle UNIQUEIDENTIFIER, @XMLdata XML; RECEIVE TOP (1) @dialog_handle = conversation_handle, @XMLdata = message_body FROM AWNewNoticeQueue; SELECT @XMLData;
Where wrong have I gone??Thanks in advance.Cheers,ozSQL