The wrox.com code downloads for this chapter are found at www.wrox.com/go/prosql2014admin on the Download Code tab. The code is in the Chapter 6 download and individually named according to the names throughout the chapter.
This chapter reviews the various objects that make up the SQL Server Service Broker. As you move through the chapter, you look at the various object types and how to create the objects. Toward the end of the chapter, you learn about the T-SQL code to use the objects when sending and receiving messages within the SQL Server database, between databases on the same server, and to databases on different servers.
At the heart of most high-volume systems is a queue that stores requests until resources are available to process them. A queue allows a limited number of worker threads to service requests from thousands of clients. A worker thread takes a request off the queue, processes it, and returns the result. The thread then proceeds to the next request on the queue.
This is significantly more efficient than starting a new thread to process each request as it comes in because it saves the startup and shutdown costs for the thread. Queues also allow more efficient use of resources because when the rate of ...