tailieunhanh - Microsoft SQL Server 2008 R2 Unleashed- P198

Microsoft SQL Server 2008 R2 Unleashed- P198:SQL Server 2005 provided a number of significant new features and enhancements over what was available in SQL Server 2000. This is not too surprising considering there was a five-year gap between these major SQL Server 2008 is not as much of a quantum leap forward from SQL Server 2005 | 1964 CHAPTER 49 SQL Server Service Broker Designing a Sample System The sample messaging system used in this chapter has the following design an update stored procedure in starts up a service that initiates a conversation with a service in XCatMgmt. It does this by sending a message to the inbound work queue of XCatMgmt. When the transaction surrounding the initial send is complete Service Broker transmits the message signaling that a catalog change for an AdventureWorks Cycles product model is ready for processing. In response to the arrival of this new message Service Broker executes a stored procedure associated with a catalog maintenance service for XCatMgmt known as its service program. This process is known as internal activation it is internal because the stored procedure resides in and is activated by SQL Server. Because a Service Broker program might not always be a stored procedure external activation is also available when you use event notification with the QUEUE_ACTIVATION event. You can create an event notification service and map it to your Service Broker service and queue by using syntax such as the following CREATE QUEUE NotificationQueue GO CREATE SERVICE EventNotificationService ON QUEUE NotificationQueue http SQL Notifications PostEventNotification GO CREATE EVENT NOTIFICATION NotifyMe ON QUEUE NotificationQueue FOR QUEUE_ACTIVATION TO SERVICE EventNotificationService1 1broker-instance-guid Note that you need to retrieve your database s Service Broker unique identifier and replace broker-instance-guid with it for the example to work. To do this you run the following query SELECT service_broker_guid FROM WHERE NAME AdventureWorks2008 go service_broker_guid 3036906E-8B9E-4266-A8C6-DD4E01B656CA 1 row s affected You should keep this query in mind because you need it later in this chapter when you re working on service conversations. Let s return to the sample system s .

TỪ KHÓA LIÊN QUAN