Share via


Environment Setup

This sample uses a Service Bus namespace, queues, topics, and subscriptions. The first step is to create the namespace, the queues, topics, and subscriptions.

This topic lists the following steps:

Sample Project Prerequisites

Create the Service Bus Namespace

Create the Queues, Topics, and Subscriptions

Sample Project Prerequisites

The sample solution is available to download at How to integrate BizTalk Server 2010 / 2013 with Service Bus for Windows Server.

The following table lists the program requirements to use the sample project:

Program Description

Service Bus for Windows Server

Provides Azure Service Bus messaging capabilities on Windows Server This sample uses a Service Bus for Windows Server namespace, queues, topics, and subscriptions.

Download available at Service Bus for Windows Server.

Visual Studio 2013

The Visual C# and BizTalk Server projects are created in Visual Studio 2013. If you are using Visual Studio 2010 Service Pack 1 (SP1), the Visual C# projects may open successfully. A BizTalk Server 2013 project requires Visual Studio 2013. A BizTalk Server 2010 project requires Visual Studio 2010.

Microsoft.ServiceBus.dll version 1.8

Provides access to the Microsoft Azure Service Bus and Service Bus for Windows Server.

The library is automatically installed with BizTalk Server 2013 and is used by SB-Messaging, WCF-NetTcpRelay, and WCF-BasicHttpRelay adapters. When using BizTalk Server 2010, there are two options:

BizTalk Server 2013 or BizTalk Server 2010

To open the BizTalk project, BizTalk Server must be installed on the Visual Studio computer. BizTalk Server 2013 requires Visual Studio 2013. BizTalk Server 2010 requires Visual Studio 2010.

Create the Service Bus Namespace

A new or existing Service Bus namespace can be used. To create a new namespace, the New-SBNamespace Windows PowerShell cmdlet is available. When using New-SBNamespace, specify the service account used by the BizTalk Server host instance, as seen in the following Windows PowerShell script:

# Import Azure PowerShell Module
Import-Module "C:\Program Files\Service Bus\1.0\ServiceBus\ServiceBus.psd1" -ErrorAction Stop

# Create a new service bus namespace
New-SBNamespace -Name MyNamespace -ManageUsers SendHostUserAccount@MyDomain.com, ReceiveHostUserAccount@MyDomain.com

The sample uses the ServiceBusDefaultNamespace and the default Management Port (9355) created when Service Bus for Windows Server is configured. To use a different namespace or Management Port, do the following:

  • Modify the binding file in the Setup folder to create the receive locations and send ports used by the BizTalk application.

  • Modify the namespace in the App.config configuration file used by the client application.

  • Change the namespace in the GetEndpointBehaviorConfiguration method of the ResponseManager class contained in the BusinessLogic project.

Create the Queues, Topics, and Subscriptions

To create the queues, topics, and subscriptions used by this demo, there are two options:

Service Bus Explorer

This tool imports the entity definition from the ServiceBusDefaultNamespace_Entities.xml file in the Setup folder:

Import Entities

Provisioning console application

Included in this sample, it uses the NamespaceManager class to create the queues, topics, and subscriptions.

Important

Run the Provisioning application as a user account that is in the managers group of this namespace.

When the Provisioning application starts, you are prompted for the following:

When complete, the Provisioning application creates the following entities in the Service Bus namespace:

  • A queue named requestqueue used by the client application to send request messages to BizTalk Server.

  • A queue named responsequeue used by BizTalk Server to send response messages to the client application.

  • A topic named requesttopic used by the client application to send request messages to BizTalk Server.

  • A topic named responsetopic used by BizTalk Server to send response messages to the client application.

  • A subscription named ItalyMilan for the requesttopic. The latter is used by BizTalk Server to receive request messages from the requesttopic. The ItalyMilan subscription has the following rule:

    1. Filter: Country='Italy' and City='Milan'

    2. Action: Set Area='Western Europe'

  • A subscription named ItalyMilan for the responsetopic. The latter is used by client application to receive response messages from the responsetopic. The ItalyMilan subscription has the following rule:

    • Filter: Country='Italy' and City='Milan'

    • Action: Set Area='Western Europe'

The Provisioning application output is similar to the following:

Provisioning Console Application

Whichever provisioning option chosen, the sample uses the following queues, topics, and subscriptions:

Service Bus Namespace

Next Step

Create the WCF Contracts

See Also

Concepts

Environment Setup
Create the WCF Contracts
Create the Endpoint Behaviors
Install and Configure Components
Create the BizTalk artifacts
Invoke the application
Test the Solution
Solution Conclusion