OK, as to your specific design question here is how I would do it:
A) Add a table like this:
CREATE TABLE PreProcessingLog
--Types are 1=UserRequest, 2=DocType1, 4=DocType2, 8=DocType3
Primary Key Clustered (CustomerID, CompletionType)
B) When the User request is issued or at the completion of each Document Type's pre-processing, INSERT the appropriate record into this table, then send the corresponding message to your service broker service.
C) The queue activation procedure should do the following:
-- 1. Begin a transaction
-- 2. Read the message from the queue
-- 3. Execute the following check:
WHERE CustomerID = @RecvdCustID
) <> 15
-- 4. Otherwise, continue to do the post-processing
-- 5. Delete all of the CustomerID=@RecvdCustID rows from PreProcessingLog
-- 6. Commit the transaction & return.
Now you can also throttle the intensity of the post-processing by limiting the number of concurrent queue activations.
, Twitter: @RBarryYoung
Proactive Performance Solutions, Inc. "Performance is our middle name."