Book Image

Microsoft Azure Development Cookbook Second Edition

Book Image

Microsoft Azure Development Cookbook Second Edition

Overview of this book

Table of Contents (15 chapters)
Microsoft Azure Development Cookbook Second Edition
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Adding messages to a Service Bus queue


In the chapter introduction, there is a comprehensive comparison between Service Bus queues and Storage queues. However, from the producer's perspective (which is the purpose of this recipe), we must keep in mind the following constraints:

  • The total message must be maximum 256 KB (quadruple of the Storage service)

  • The total queue size is up to 5 GB (significantly smaller than the Storage service)

  • In the case of TCP communication, there is a cap on the concurrent connections (currently the value is 100)

We are comparing the two platforms by pursuing the same goals; the Service Bus queue adds more advanced features that the Storage service does not implement.

In this recipe, we'll learn how to add messages to a Service Bus queue.

Getting ready

This recipe assumes the following code is in the application configuration file:

<appSettings>
  <add key="ServiceBusConnectionString" 
        value="Endpoint=sb://[your namespace].servicebus.windows.net;SharedSecretIssuer...