﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / Programming / Service Broker  / messages not appearing in service broker queue / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Tue, 21 May 2013 18:58:37 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: messages not appearing in service broker queue</title><link>http://www.sqlservercentral.com/Forums/Topic1299471-1281-1.aspx</link><description>Have I ever seen that one before? :-D</description><pubDate>Mon, 14 May 2012 05:44:01 GMT</pubDate><dc:creator>Nils Gustav Stråbø</dc:creator></item><item><title>RE: messages not appearing in service broker queue</title><link>http://www.sqlservercentral.com/Forums/Topic1299471-1281-1.aspx</link><description>brillian - thanks - "The session keys for this conversation could not be created or accessed. The database master key is required for this operation."OOPS - forgot to create the database master key</description><pubDate>Mon, 14 May 2012 05:42:38 GMT</pubDate><dc:creator>MVDBA</dc:creator></item><item><title>RE: messages not appearing in service broker queue</title><link>http://www.sqlservercentral.com/Forums/Topic1299471-1281-1.aspx</link><description>Any messages that Service Broker is unable to deliver can be found is sys.transmission_queue. There is a column called transmission_status that will provide more details about why the message hasn't been delivered.</description><pubDate>Mon, 14 May 2012 05:31:38 GMT</pubDate><dc:creator>Nils Gustav Stråbø</dc:creator></item><item><title>RE: messages not appearing in service broker queue</title><link>http://www.sqlservercentral.com/Forums/Topic1299471-1281-1.aspx</link><description>oh - and i also forgot to say i switched the message type to VALIDATION=NONE just in case it was badly formed XML, didn't fix the problem</description><pubDate>Mon, 14 May 2012 05:26:28 GMT</pubDate><dc:creator>MVDBA</dc:creator></item><item><title>messages not appearing in service broker queue</title><link>http://www.sqlservercentral.com/Forums/Topic1299471-1281-1.aspx</link><description>Hi guyslooking for the obvious think that i've overlooked herei'm using service broker to parellelize a process where we import CSV files into a database. i have a procedure that looks at a table with a list of files to process and then starts a conversation and puts a message on the queue for each file.the problem is that even though my proc is sending the messages, nothing is appearing in either queueI've enabled service broker and set trustworthy on - what am i missing ?here is my sample code [code="sql"]if not exists(select top 1 id from dbo.ProcessFile)begin	--drop out if there are no files to process	returnend--set up the conversationDECLARE @handle uniqueidentifierBEGIN DIALOG CONVERSATION @handleFROM SERVICE FileProcessServiceTO SERVICE 'FileProcessService_receive'ON CONTRACT FileContract;--start sending messagesdeclare @id bigintdeclare @folder varchar(255)declare @filename varchar(255)declare @message xml--loop through the records that are unprocesseddeclare curs1 cursor FAST_FORWARD for 	select ID,folder,filename from dbo.ProcessFile where status=0open curs1fetch next from curs1 into @id,@folder,@filenamewhile @@FETCH_STATUS=0begin	--set the message	set @message='&amp;lt;message&amp;gt;&amp;lt;file&amp;gt;'	--+@folder+'\'	--+@filename	+'X&amp;lt;/file&amp;gt;&amp;lt;/message&amp;gt;'	print convert(varchar(max),@message)	--Sends a message	;SEND ON CONVERSATION @handle	MESSAGE TYPE ImportFile	(@message)	--mark it as sent to queue	update dbo.ProcessFile set status=1 where ID=@id	fetch next from curs1 into @id,@folder,@filenameendclose curs1deallocate curs1--And ends the conversationEND CONVERSATION @handle WITH CLEANUP;[/code]here is the table it reads from (and some sample data)[code="sql"]CREATE TABLE [dbo].[ProcessFile](	[id] [bigint] IDENTITY(1,1) NOT NULL,	[folder] [varchar](255) NOT NULL,	[filename] [varchar](255) NOT NULL,	[status] [int] NOT NULL,PRIMARY KEY CLUSTERED (	[id] ASC)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]) ON [PRIMARY]GOinsert into Processfile (folder,filename,status) select 'c:\files','text.csv',0)[/code]</description><pubDate>Mon, 14 May 2012 05:25:37 GMT</pubDate><dc:creator>MVDBA</dc:creator></item></channel></rss>