Back To Basics: Service Broker Services

Published On: 2008-06-16By:

Services are used to bind contracts to queues.  They are also used to database to database, or server to server routing of messages via routes (we’ll talk about them later).  Unlike most other objects within SQL Server, the name of the service is case sensitive, no matter what collation you have set for your database.  When using server to server queueing the service names must be identical, including case as SQL Servers uses a hash of the service name to locate the correct service.

(Service names are not actually case sensitive if you arne’t using routing, but if you are going to start routing the messages later it’s better to start off getting them in the correct case.)

The syntax to create the service is pretty straight forward.

CREATE SERVICE ServiceName
ON QUEUE QueueName (ContractName)

If the service will only be the initiator then the contract name can be omited if preferred.  If you want to create a multi-user contact you can specify additional contracts by simply making a comma seperated list of contract names.

CREATE SERVICE ServiceName
ON QUEUE QueueName;

CREATE SERVICE ServiceName
ON QUEUE QueueName (ContractName1, ContractName2);

Denny


Contact the Author | Contact DCAC

Video

Globally Recognized Expertise

As Microsoft MVP’s and Partners as well as VMware experts, we are summoned by companies all over the world to fine-tune and problem-solve the most difficult architecture, infrastructure and network challenges.

And sometimes we’re asked to share what we did, at events like Microsoft’s PASS Summit 2015.

Awards & Certifications

Microsoft Partner    Microsoft MVP    Microsoft Certified Master    VMWare Partner    VMWare vExpert
   Best Full-Service Cloud Technology Consulting Company    Insights Sccess Award    Technology Headlines Award    Golden Bridge Gold Award    CIO Review Top 20 Azure Solutions Providers
Share via
Copy link