Readme_HelloWorld Sample

[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]

The Hello World sample provides a simple Service Broker application that shows you how to send and receive a message by using Service Broker.

Samples are provided for educational purposes only. They are not intended to be used in a production environment and have not been tested in a production environment. Microsoft does not provide technical support for these samples. Sample applications and assemblies should not be connected to or used with your production SQL Server database or your report server without the permission of the system administrator.

Before running this sample, make sure that SQL Server is installed, including the following components:

  • SQL Server Database Engine
  • The AdventureWorks sample database
  • Database Engine Samples

Running the Sample

To run the sample

  1. Open the project file in SQL Server Management Studio.

  2. Run Setup.sql. This script creates the Service Broker objects for the services.

  3. Open SendMessage.sql, select all lines from the beginning of the file to the comment ‘End Selection Here' and run selected part of the script. This part of the script begins a dialog conversation from InitiatorService to TargetService and sends a message on this conversation.

  4. Run ReceivesMessages.sql. This script receives Service Broker messages from the TargetQueue, displays the messages and ends the corresponding conversations at the target.

  5. Open SendMessage.sql, select all lines from the comment ‘End Selection Here' to the end of the file and run selected part of the script. This part of the script waits for a response message, displays the message and ends the corresponding conversation at the initiator.