Chapter 17. Service Broker

SQL Server 2005 introduces Service Broker —a technology that is part of the Database Engine that helps you to build scalable, loosely coupled database applications. Service Broker provides a message-based communications platform that integrates independent application components. Service Broker makes it easier to build distributed applications by providing an asynchronous programming framework that includes queuing and reliable messaging. Service Broker can be used both for applications that use a single SQL Server instance and for applications that are distributed across multiple instances. The Service Broker Framework provides a T-SQL Data Manipulation Language (DML) interface for sending and receiving streams of asynchronous messages.

Architecture

Before you look at the message flow within a Service Broker solution, there are some key Service Broker terms with which you should be familiar.

A message is a unit of information exchanged between applications that use Service Broker. Internally, a message is stored in SQL Server as a varbinary(max) data type. Each message has a message type that defines the name and type of data that a message contains. Each message has a unique identity. Each message also has a unique sequence number within its conversation, which is used to enforce message ordering.

A conversation is a reliable, persistent communications channel made up of a series of messages. Messages are guaranteed to arrive in the order in which they ...

Get Programming SQL Server 2005 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.