Back To Basics: Service Broker Contracts

Published On: 2008-06-02By:

Every Service Broker conversation requires a contract.  The contract defines which message type or types will be used, as well as who (sender or receiver) can use which message types.  The contract is specified when the conversation is created.

The syntax for creating the contract is pretty straight forward.

CREATE CONTRACT [ContractName]
(MessageType SENT BY ANY)

The SEND BY portion can be used as many times as is needed for each Message Type which is defined on the contract.  It must be listed at least once as you can not have a contract with no message types.  You can specify that the Message Type be used by the INITIATOR, the TARGET or by both (by using the ANY keyword).

A more complex Contract would look something like this.

CREATE CONTRACT [ContractName]
(MessageType_I SENT BY INITIATOR,
MessageType_T SENT BY TARGET)

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