Book Image

SOA Patterns with BizTalk Server 2013 and Microsoft Azure

By : Richard Seroter, Mark T Brimble, Coen J Dijkgraaf, Mahindra Morar, Mark Brimble, Colin Dijkgraaf, Johann Cooper
Book Image

SOA Patterns with BizTalk Server 2013 and Microsoft Azure

By: Richard Seroter, Mark T Brimble, Coen J Dijkgraaf, Mahindra Morar, Mark Brimble, Colin Dijkgraaf, Johann Cooper

Overview of this book

Table of Contents (21 chapters)
SOA Patterns with BizTalk Server 2013 and Microsoft Azure Second Edition
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Topics


Topics are another communication model that provide a publish/subscribe architecture pattern. This allows a message to be consumed by many subscribers, and each subscriber is able to process the message independently.

A Topic has similar characteristics to a Service Bus Queue. When you create a topic by code, you would normally use the NamespaceManager class, as follows:

//create the token
TokenProvider token = 
    TokenProvider.CreateSharedSecretTokenProvider(name, key);
//create the uri
Uri uri = ServiceBusEnvironment.CreateServiceUri("sb", "mynamespace", string.Empty);
//create a namespace instance
NamespaceManager nsManager = new NamespaceManager(uri, token);

You then use the NamespaceManager instance to create a Topic, just as you would when you create a Queue.

nsManager.CreateTopic("SalesTopicQueue");

Note

Note that you cannot use the same name for a Queue and Topic within the same namespace. This will cause a MessagingEntityAlreadyExists exception to be thrown.

Once the Topic has...