Staff DotNet Blogs

Congratulations to our workmate Antonio Zamora for winning the second place at VMWare Toolkit for Windows Scripting contest.  Antonio submitted a script called "VMWare Infrastructure Power Documenter" which is a reporting tool for VM Infrastructure built on top VMWare Infrastructure Power Shell Tool Kit and Power Tools for Open Xml suite.

Well done Toño!!!!!

A promise is a promise, so in this blog post I provided you a sample about how to integrate SQL Server 2005 Service Broker with your .NET Framework based applications. Download source code and installation guide from here and start taking a look at it. I will publish a post explaining the sample very soon. Meanwhile enjoy the sample.

Don't worry about saving space in your RSS reader to accommodate all our blogs RSS files (although we see no problem about that ;)).  Now you only have to point your RSS reader to our "What's New" blog and then you will be keep updated about new postings in Staff DotNet blogs.  Enjoy them!!!

Service Broker is a technology included in SQL Server 2005 that allows database developers to build secure, reliable, and scalable applications using a robust asynchronous programming model.  Service Broker infrastructure includes a transactional and asynchronous message delivery system to exchange messages between applications and database instances. 

Using the service broker

Service Broker is useful in applications that must use or display information simultaneously from multiple databases, applications that must perform large-scale batch processing, large applications that access multiple SQL Server databases, and applications that collect data from a large set of sources.

Enabling the service broker

In order to use the Service Broker you must enable the service.  In order to do so  check the is_broker_enabled column of the sys.databases catalog view  (a 0 value means that the Service Broker is disable).  If service message delivery is disabled use the following script to enable it:

ALTER DATABASE [databaseName] SET Enable_Broker;

GO

Endpoints

Defining an endpoint is required in order to allow sending or receiving messages by using the Service Broker. Use the following code to create an endpoint (please notice that “LISTENER_PORT” should be opened at the firewall if you want the Service Broker to be able to process messages):

CREATE ENDPOINT ServiceBroker_Endpoint

STATE = STARTED

AS TCP

   (LISTENER_PORT=1443, LISTENER_IP=all)

FOR SERVICE_BROKER

                   (AUTHENTICATION=windows, ENCRYPTION=supported)

 

Disabling the service broker

Use the following script if you don’t want to continue using the Service Broker:

ALTER ENDPOINT ServiceBroker_Endpoint

STATE=STOPPED;

GO   

 

ALTER DATABASE [databaseName] SET Disable_Broker;

GO         

Coming next

Once we all know the basics about Service Broker it is time to see it in action, but this will be up to the next post in this series.  See you soon!!!