dat340内容摘要:

5. How to Receive a Message How to Enable Service Broker in a Database Check Service Broker status 1 Enable Service Broker 2 SELECT is_broker_enabled FROM WHERE database_id = db_id() ALTER DATABASE AdventureWorks SET ENABLE_BROKER Implementing Services Design: Message types Contracts Queues Services Service program logic to Create Contracts Create message types 1 Create contract 2 CREATE CONTRACT [//] ( [//] SENT BY INITIATOR, [// ] SENT BY TARGET ) CREATE MESSAGE TYPE [//] VALIDATION = WELL_FORMED_XML CREATE MESSAGE TYPE [//] VALIDATION = VALID_XML WITH SCHEMA COLLECTION awschemas to Create Queues Create queue name 1 Choose whether queue is available 2 Specify any activation parameters 3 CREATE QUEUE ExpenseQueue CREATE QUEUE ExpenseQueueWithActivation WITH STATUS = OFF, ACTIVATION ( PROCEDURE_NAME = ProcessExpense, MAX_QUEUE_READERS = 5, EXECUTE AS SELF) Create service name to Create Services 1 Choose storage queue List contracts for which the service is a target Choose whether to retain messages for conversation lifetime 2 3 4 CREATE SERVICE [//] ON QUEUE ExpenseQueue ( [//] ) to Send a Message Declare a dialog handle variable 1 Begin a dialog conversation 2 Send the message 3 DECLARE @dialog_handle uniqueidentifier DECLARE @dialog。
阅读剩余 0%
本站所有文章资讯、展示的图片素材等内容均为注册用户上传(部分报媒/平媒内容转载自网络合作媒体),仅供学习参考。 用户通过本站上传、发布的任何内容的知识产权归属用户或原始著作权人所有。如有侵犯您的版权,请联系我们反馈本站将在三个工作日内改正。