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 / December 2005

Tip: Looking for answers? Try searching our database.

No messages in Receiveing Queue

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Kevin Thomas - 17 Dec 2005 00:19 GMT
Hello,

In trying to learn SB, I have created a simple "Hello World" app as listed
below.  The problem is that no matter how I've futzed with it so far,
nothing ever shows up in the "ktTestReceivingQueue".    If I don't execute
the line, "end conversation @handle ;" then I see the message in the
"ktTestSendingQueue".

To read the queues I am using:
[select/receive] cast(message_body as xml), * from ktTestReceivingQueue
[select/receive] cast(message_body as xml), * from ktTestSendingQueue

Anybody see any obvious reason why the message doesn't show up in the
receiving queue?

--Set up the system
create message type ktTestMessageType
validation = well_formed_xml

create contract ktTestContract
(ktTestMessageType sent by any)

create queue ktTestSendingQueue
with status = on, retention = on

create queue ktTestReceivingQueue
with status = on, retention = on

create SERVICE ktTestSendingService
on QUEUE ktTestSendingQueue
(ktTestContract)

create SERVICE ktTestReceivingService
on QUEUE ktTestReceivingQueue
(ktTestContract)

create route ktTestRoute
with service_name = 'ktTestReceivingService',
address = 'local'

--Send a message
declare @handle uniqueidentifier;

begin dialog conversation @handle
from service [ktTestSendingService]
to service 'ktTestReceivingService', 'CURRENT DATABASE'
on contract ktTestContract
with lifetime = 600; -- seconds

send on conversation @handle
message type ktTestMessageType
 ('<hello>world</hello><datetime>' + convert(varchar,getdate()) +
'</datetime>');

end conversation @handle ;

Thanks,

Kevin
Remus Rusanu [MSFT] - 17 Dec 2005 01:47 GMT
The dialog you start is secure. Secure dialogs require two additional steps:
- create a database master key (see
http://msdn2.microsoft.com/en-us/library/ms174382.aspx)
- create a remote service binding for the "ktTestReceivingService" service
(see http://msdn2.microsoft.com/en-us/library/ms178024.aspx)

For you test to work, you can use a dialog w/o security, by specifying
ENCRYPTION = OFF in you BEGIN DIALOG:

begin dialog conversation @handle
from service [ktTestSendingService]
to service 'ktTestReceivingService', 'CURRENT DATABASE'
on contract ktTestContract
with encryption = off, lifetime = 600; -- seconds

For an explanation on dialog security, see
http://msdn2.microsoft.com/en-us/library/ms166036.aspx and the how-to steps
at http://msdn2.microsoft.com/en-us/library/ms166047(en-US,SQL.90).aspx

The reason you see the message in the sender's queue before the END DIALOG
statement is because you have retention on the queue. Retention kees a copy
of sent and received message for the duration of the dialog.

To investigate these kind of issues, the first step is to look in
sys.transmission_queue for the 'transmission_status'. In you case (before
using ENCRYPTION = OFF) it should say something like 'The session keys for
this conversation could not be created or accessed. The database master key
is required for this operation.'

Signature

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

> Hello,
>
[quoted text clipped - 55 lines]
>
> Kevin
Kevin Thomas - 20 Dec 2005 01:36 GMT
Yep, that did the trick.

Thanks a lot for your help,

Kevin

> The dialog you start is secure. Secure dialogs require two additional
> steps:
[quoted text clipped - 86 lines]
>>
>> Kevin
 
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.