USE BrokerDB2
GO


---
--- Step 4: Receive message and return the reply.
---

DECLARE @h UNIQUEIDENTIFIER;
DECLARE @invreq XML;
DECLARE @invresp XML

BEGIN TRANSACTION;
RECEIVE TOP(1)
 @invreq = CAST(message_body AS XML),
 @h = conversation_handle
 FROM InvRequestQueue;
PRINT CONVERT(VARCHAR(4000), @invreq);
SEND ON CONVERSATION @h
 MESSAGE TYPE InvResponseMsg ('<OK/>');
END CONVERSATION @h
COMMIT;
GO


--
--
select name, service_broker_guid from sys.databases