SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Internal Activation Procedure


Internal Activation Procedure

Author
Message
musclesonvacation
musclesonvacation
Forum Newbie
Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)

Group: General Forum Members
Points: 3 Visits: 28
Hi,
I having some issues getting Service Broker to work with an Internal Activation Procedure.

I have the following code.

USE [CabinetDoor]
GO

--ALTER DATABASE CabinetDoor SET ENABLE_BROKER;

IF EXISTS (SELECT * FROM sys.services WHERE name = N'WFProductionInProcess_Target')
BEGIN
DROP SERVICE
[WFProductionInProcess_Target];
END

IF EXISTS (SELECT * FROM sys.services WHERE name = N'WFProductionSchedule_Initiator')
BEGIN
DROP SERVICE
[WFProductionSchedule_Initiator];
END

IF EXISTS (SELECT * FROM sys.service_queues WHERE name = N'WFPIPScheduleInitiatorQueue')
BEGIN
DROP QUEUE WFPIPScheduleInitiatorQueue;
END

IF EXISTS (SELECT * FROM sys.service_queues WHERE name = N'WFPIPScheduleTargetQueue')
BEGIN
DROP QUEUE WFPIPScheduleTargetQueue;
END

IF EXISTS (SELECT * FROM sys.service_contracts WHERE name = N'WFPIPContract')
BEGIN
DROP CONTRACT
[WFPIPContract];
END

IF EXISTS (SELECT * FROM sys.service_message_types WHERE name = N'WFPIPRequestMessage')
BEGIN
DROP MESSAGE TYPE
[WFPIPRequestMessage];
END

IF EXISTS (SELECT * FROM sys.service_message_types WHERE name = N'WFPIPReplyMessage')
BEGIN
DROP MESSAGE TYPE
[WFPIPReplyMessage];
END

GO

--Create Message Type
CREATE MESSAGE TYPE [WFPIPRequestMessage]
VALIDATION = WELL_FORMED_XML;

CREATE MESSAGE TYPE [WFPIPReplyMessage]
VALIDATION = WELL_FORMED_XML;

GO

--Create Contract
CREATE CONTRACT [WFPIPContract]
(
[WFPIPRequestMessage] SENT BY INITIATOR
, [WFPIPReplyMessage] SENT BY TARGET
);

GO

--Create Queue
CREATE QUEUE WFPIPScheduleTargetQueue
WITH STATUS=ON, ACTIVATION
(STATUS=ON, MAX_QUEUE_READERS=5,
PROCEDURE_NAME = BrokerTargetActiveProc, EXECUTE AS SELF),
POISON_MESSAGE_HANDLING (STATUS=OFF);

CREATE SERVICE [WFProductionInProcess_Target]
ON QUEUE WFPIPScheduleTargetQueue (WFPIPContract);

CREATE QUEUE WFPIPScheduleInitiatorQueue

--Create WFProductionSchedule_Initiator
CREATE SERVICE WFProductionSchedule_Initiator
ON QUEUE WFPIPScheduleInitiatorQueue;



musclesonvacation
musclesonvacation
Forum Newbie
Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)

Group: General Forum Members
Points: 3 Visits: 28
This forum will not allow me to post all my code, so I have attach it as files.

I call the code in Start Conversation from a desktop application, using integrated security.

I have implemented one other service broker project, and I remember doing some security changes to allow the queue to receive and send and such. Is this all I am missing?

I have followed several tutorials without any luck.

Thanks
Gary
Attachments
Setup.txt (10 views, 1.00 KB)
Activation SP.txt (7 views, 1.00 KB)
Start Conversation.txt (16 views, 789 bytes)
WolfgangE
WolfgangE
SSC-Addicted
SSC-Addicted (473 reputation)SSC-Addicted (473 reputation)SSC-Addicted (473 reputation)SSC-Addicted (473 reputation)SSC-Addicted (473 reputation)SSC-Addicted (473 reputation)SSC-Addicted (473 reputation)SSC-Addicted (473 reputation)

Group: General Forum Members
Points: 473 Visits: 792
There are many reasons why Service Broker can fail.

For analyzing this I recommend to disable the activation procedure. This way you can see if the data is at least reaching the target queue.
If so, call the activation procedure manually and have a look what it's doing.

Have a look at the command line utility "ssbdiagnose" (http://msdn.microsoft.com/en-us/library/bb934450.aspx)
It sends a test package between defined services. It helped me a lot getting Service Broker run.
musclesonvacation
musclesonvacation
Forum Newbie
Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)

Group: General Forum Members
Points: 3 Visits: 28
Hi,

Thanks for replying.

I ended up following another tutorial, that defined all stored procedure parts gradually. I think it was Remus somebody, basically testing without the activation turned on.

Thanks
Gary
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search