<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:image="http://purl.org/rss/1.0/modules/image/">
    <channel>
        <title>Azure Service Bus</title>
        <link>http://www.rickgaribay.net/category/44.aspx</link>
        <description>Azure Service Bus</description>
        <language>en-US</language>
        <copyright>Rick G. Garibay</copyright>
        <managingEditor>rick@rickgaribay.net</managingEditor>
        <generator>Subtext Version 1.9.5.176</generator>
        <item>
            <title>Common Service Bus Queue Operations with the REST API</title>
            <link>http://rickgaribay.net/archive/2012/01/19/common-service-bus-queue-operations-with-the-rest-api.aspx</link>
            <description>&lt;p&gt;Azure Service Bus Brokered Messaging provides durable pull-based pub-sub, complimenting it’s older sibling Relay Messaging which uses a push messaging model. While both enable hybrid composition across traditional business, trust and network boundaries, they provide unique capabilities in and of themselves. &lt;/p&gt;  &lt;p&gt;As with Relay Messaging, Brokered Messaging provides first class support for WCF with the NetMessagingBinding, but expands the developer surface to general .NET and cross-platform/mobility scenarios by offering the .NET Client and REST API respectively.&lt;/p&gt;  &lt;p&gt;Of the 3 APIs, the .NET Client API is the most robust and seems to be the most documented.&lt;/p&gt;  &lt;p&gt;The simplicity of the WCF programming model (the illusion that messages are being pushed to your endpoint) is balanced with some restrictions that naturally fall out of the scope of one-way messaging including queue/topic/subscription/rule creation and support for peek lock.&lt;/p&gt;  &lt;p&gt;In this regard, while not as robust as the .NET Client API, the REST API offers a more comprehensive feature set and when working on solutions that must be interoperable across client platforms or due to other restrictions, the REST API is a great choice.&lt;/p&gt;  &lt;p&gt;Microsoft has documented the REST API in the &lt;a href="http://msdn.microsoft.com/en-us/library/windowsazure/hh367521.aspx#BKMK_REST5prod" target="_blank"&gt;Service Bus REST API Reference&lt;/a&gt;, but there are not a ton of imperative examples out there that show WebClient or HttpWebRequest, so the purpose of this post is to share some nitty gritty examples of how to get some of the most common operations done in C#.&lt;/p&gt;  &lt;p&gt;Please note that my goal is not to be elegant or use the tersest or most fluid syntax possible in this samples, but rather to get some quick and dirty examples out there, well, quickly. &lt;/p&gt;  &lt;p&gt;As such, the unit tests should be self explanatory, but if you have any questions, please don’t hesitate to ask. &lt;/p&gt;  &lt;p&gt;Feedback, comments related to the API or WebClient techniques welcome &lt;img style="border-bottom-style: none; border-right-style: none; border-top-style: none; border-left-style: none" class="wlEmoticon wlEmoticon-smile" alt="Smile" src="http://rickgaribay.net/Images/customcontent/Common-Service-Bus-Patterns-with-the-RES_795D/wlEmoticon-smile.png" /&gt;&lt;/p&gt;  &lt;div class="csharpcode"&gt;   &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; System;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; System.Text;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; System.Collections.Generic;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; System.Linq;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; Microsoft.VisualStudio.TestTools.UnitTesting;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; System.Collections.Specialized;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; System.Net;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; System.Runtime.Serialization.Json;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; System.Runtime.Serialization;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; System.IO;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt; &lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  12:  &lt;/span&gt;&lt;span class="kwrd"&gt;namespace&lt;/span&gt; RESTAPITests&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  13:  &lt;/span&gt;{&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  14:  &lt;/span&gt;    [TestClass]&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  15:  &lt;/span&gt;    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; RESTAPITests&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  16:  &lt;/span&gt;    {&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  17:  &lt;/span&gt; &lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  18:  &lt;/span&gt;        &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; serviceNamespace = &lt;span class="str"&gt;"[NAMESPACE]"&lt;/span&gt;;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  19:  &lt;/span&gt;        &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; issuerName = &lt;span class="str"&gt;"owner"&lt;/span&gt;;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  20:  &lt;/span&gt;        &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; issuerSecret = &lt;span class="str"&gt;"[KEY]"&lt;/span&gt;;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  21:  &lt;/span&gt;        &lt;span class="kwrd"&gt;const&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; sbHostName = &lt;span class="str"&gt;"servicebus.windows.net"&lt;/span&gt;;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  22:  &lt;/span&gt;        &lt;span class="kwrd"&gt;const&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; acsHostName = &lt;span class="str"&gt;"accesscontrol.windows.net"&lt;/span&gt;;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  23:  &lt;/span&gt;        &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; relativeAddress = &lt;span class="str"&gt;"[Queue]"&lt;/span&gt;;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  24:  &lt;/span&gt;        &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; baseAddress;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  25:  &lt;/span&gt;        &lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  26:  &lt;/span&gt; &lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  27:  &lt;/span&gt;        [TestMethod]&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  28:  &lt;/span&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; SendMessageShouldSucceedWithoutError()&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  29:  &lt;/span&gt;        {&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  30:  &lt;/span&gt;            &lt;span class="kwrd"&gt;string&lt;/span&gt; body = &lt;span class="str"&gt;"foo"&lt;/span&gt;;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  31:  &lt;/span&gt; &lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  32:  &lt;/span&gt;            var token = GetToken(issuerName, issuerSecret);&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  33:  &lt;/span&gt; &lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  34:  &lt;/span&gt;            baseAddress = GetBaseAddress();&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  35:  &lt;/span&gt;            &lt;span class="kwrd"&gt;string&lt;/span&gt; fullAddress = baseAddress + relativeAddress + &lt;span class="str"&gt;"/messages"&lt;/span&gt;;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  36:  &lt;/span&gt; &lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  37:  &lt;/span&gt;            WebClient webClient = &lt;span class="kwrd"&gt;new&lt;/span&gt; WebClient();&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  38:  &lt;/span&gt;            webClient.Headers[HttpRequestHeader.Authorization] = token;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  39:  &lt;/span&gt;            webClient.UploadData(fullAddress, &lt;span class="str"&gt;"POST"&lt;/span&gt;, Encoding.UTF8.GetBytes(body));   &lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  40:  &lt;/span&gt; &lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  41:  &lt;/span&gt;        }&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  42:  &lt;/span&gt; &lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  43:  &lt;/span&gt;        [TestMethod]&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  44:  &lt;/span&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; PeekLockMessageShouldReturnLockId()&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  45:  &lt;/span&gt;        {&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  46:  &lt;/span&gt;            var token = GetToken(issuerName, issuerSecret);&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  47:  &lt;/span&gt; &lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  48:  &lt;/span&gt;            baseAddress = GetBaseAddress();&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  49:  &lt;/span&gt; &lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  50:  &lt;/span&gt;            &lt;span class="rem"&gt;// Read and lock the message. Unless released, the lock will expire within the configured lock duration (on the queue)&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  51:  &lt;/span&gt;            &lt;span class="kwrd"&gt;string&lt;/span&gt; fullAddress = baseAddress + relativeAddress + &lt;span class="str"&gt;"/messages/head"&lt;/span&gt;;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  52:  &lt;/span&gt;           &lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  53:  &lt;/span&gt;            WebClient webClient = &lt;span class="kwrd"&gt;new&lt;/span&gt; WebClient();&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  54:  &lt;/span&gt;            webClient.Headers[HttpRequestHeader.Authorization] = token;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  55:  &lt;/span&gt;            webClient.UploadData(fullAddress, &lt;span class="str"&gt;"POST"&lt;/span&gt;, &lt;span class="kwrd"&gt;new&lt;/span&gt; &lt;span class="kwrd"&gt;byte&lt;/span&gt;[0]{});&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  56:  &lt;/span&gt; &lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  57:  &lt;/span&gt;            var props = webClient.ResponseHeaders[&lt;span class="str"&gt;"BrokerProperties"&lt;/span&gt;];&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  58:  &lt;/span&gt; &lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  59:  &lt;/span&gt;            &lt;span class="rem"&gt;// Deserialize the JSON header to a simple class&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  60:  &lt;/span&gt;            DataContractJsonSerializer serializer = &lt;span class="kwrd"&gt;new&lt;/span&gt; DataContractJsonSerializer(&lt;span class="kwrd"&gt;typeof&lt;/span&gt;(BrokerProperty));&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  61:  &lt;/span&gt;            &lt;span class="kwrd"&gt;using&lt;/span&gt; (MemoryStream stream = &lt;span class="kwrd"&gt;new&lt;/span&gt; MemoryStream(Encoding.Unicode.GetBytes(props)))&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  62:  &lt;/span&gt;            {&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  63:  &lt;/span&gt;                var result = (BrokerProperty)serializer.ReadObject(stream);&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  64:  &lt;/span&gt; &lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  65:  &lt;/span&gt;                Assert.IsNotNull(result.LockToken); &lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  66:  &lt;/span&gt;            }&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  67:  &lt;/span&gt;    &lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  68:  &lt;/span&gt;        }&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  69:  &lt;/span&gt; &lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  70:  &lt;/span&gt;        [TestMethod]&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  71:  &lt;/span&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; PeekLockMessageAndAbandonShouldSucceed()&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  72:  &lt;/span&gt;        {&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  73:  &lt;/span&gt;            var token = GetToken(issuerName, issuerSecret);&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  74:  &lt;/span&gt; &lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  75:  &lt;/span&gt;            baseAddress = GetBaseAddress();&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  76:  &lt;/span&gt; &lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  77:  &lt;/span&gt;            &lt;span class="rem"&gt;// Read and lock the message. Unless released, the lock will expire within the configured lock duration (on the queue)&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  78:  &lt;/span&gt;            &lt;span class="kwrd"&gt;string&lt;/span&gt; fullAddress = baseAddress + relativeAddress + &lt;span class="str"&gt;"/messages/head"&lt;/span&gt;;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  79:  &lt;/span&gt; &lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  80:  &lt;/span&gt;            WebClient webClient = &lt;span class="kwrd"&gt;new&lt;/span&gt; WebClient();&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  81:  &lt;/span&gt;            webClient.Headers[HttpRequestHeader.Authorization] = token;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  82:  &lt;/span&gt;            webClient.UploadData(fullAddress, &lt;span class="str"&gt;"POST"&lt;/span&gt;, &lt;span class="kwrd"&gt;new&lt;/span&gt; &lt;span class="kwrd"&gt;byte&lt;/span&gt;[0] { });&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  83:  &lt;/span&gt; &lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  84:  &lt;/span&gt;            var props = webClient.ResponseHeaders[&lt;span class="str"&gt;"BrokerProperties"&lt;/span&gt;];&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  85:  &lt;/span&gt; &lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  86:  &lt;/span&gt;            &lt;span class="rem"&gt;// Deserialize the JSON header to a simple class&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  87:  &lt;/span&gt;            DataContractJsonSerializer serializer = &lt;span class="kwrd"&gt;new&lt;/span&gt; DataContractJsonSerializer(&lt;span class="kwrd"&gt;typeof&lt;/span&gt;(BrokerProperty));&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  88:  &lt;/span&gt; &lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  89:  &lt;/span&gt;            &lt;span class="kwrd"&gt;using&lt;/span&gt; (MemoryStream stream = &lt;span class="kwrd"&gt;new&lt;/span&gt; MemoryStream(Encoding.Unicode.GetBytes(props)))&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  90:  &lt;/span&gt;            {&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  91:  &lt;/span&gt;                var result = (BrokerProperty)serializer.ReadObject(stream);&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  92:  &lt;/span&gt; &lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  93:  &lt;/span&gt;                &lt;span class="rem"&gt;// Bail on the message, release the lock so it is available for another consumer&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  94:  &lt;/span&gt;                fullAddress = baseAddress + relativeAddress + String.Format(&lt;span class="str"&gt;"/messages/{0}/{1}"&lt;/span&gt;, result.MessageId, result.LockToken);&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  95:  &lt;/span&gt;            }&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  96:  &lt;/span&gt; &lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  97:  &lt;/span&gt;            webClient = &lt;span class="kwrd"&gt;new&lt;/span&gt; WebClient();&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  98:  &lt;/span&gt;            webClient.Headers[HttpRequestHeader.Authorization] = token;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  99:  &lt;/span&gt;            webClient.UploadData(fullAddress, &lt;span class="str"&gt;"PUT"&lt;/span&gt;, &lt;span class="kwrd"&gt;new&lt;/span&gt; &lt;span class="kwrd"&gt;byte&lt;/span&gt;[0] { });&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt; 100:  &lt;/span&gt;           &lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 101:  &lt;/span&gt;        }&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt; 102:  &lt;/span&gt; &lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 103:  &lt;/span&gt;        [TestMethod]&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt; 104:  &lt;/span&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; PeekLockMessageAndCompleteShouldSucceed()&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 105:  &lt;/span&gt;        {&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt; 106:  &lt;/span&gt;            var token = GetToken(issuerName, issuerSecret);&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 107:  &lt;/span&gt; &lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt; 108:  &lt;/span&gt;            baseAddress = GetBaseAddress();&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 109:  &lt;/span&gt; &lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt; 110:  &lt;/span&gt;            &lt;span class="rem"&gt;// Peek lock the message&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 111:  &lt;/span&gt;            &lt;span class="kwrd"&gt;string&lt;/span&gt; fullAddress = baseAddress + relativeAddress + &lt;span class="str"&gt;"/messages/head"&lt;/span&gt;;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt; 112:  &lt;/span&gt; &lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 113:  &lt;/span&gt;            WebClient webClient = &lt;span class="kwrd"&gt;new&lt;/span&gt; WebClient();&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt; 114:  &lt;/span&gt;            webClient.Headers[HttpRequestHeader.Authorization] = token;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 115:  &lt;/span&gt;            webClient.UploadData(fullAddress, &lt;span class="str"&gt;"POST"&lt;/span&gt;, &lt;span class="kwrd"&gt;new&lt;/span&gt; &lt;span class="kwrd"&gt;byte&lt;/span&gt;[0] { });&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt; 116:  &lt;/span&gt; &lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 117:  &lt;/span&gt;            var props = webClient.ResponseHeaders[&lt;span class="str"&gt;"BrokerProperties"&lt;/span&gt;];&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt; 118:  &lt;/span&gt; &lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 119:  &lt;/span&gt;            DataContractJsonSerializer serializer = &lt;span class="kwrd"&gt;new&lt;/span&gt; DataContractJsonSerializer(&lt;span class="kwrd"&gt;typeof&lt;/span&gt;(BrokerProperty));&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt; 120:  &lt;/span&gt; &lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 121:  &lt;/span&gt;            &lt;span class="kwrd"&gt;using&lt;/span&gt; (MemoryStream stream = &lt;span class="kwrd"&gt;new&lt;/span&gt; MemoryStream(Encoding.Unicode.GetBytes(props)))&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt; 122:  &lt;/span&gt;            {&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 123:  &lt;/span&gt;                var result = (BrokerProperty)serializer.ReadObject(stream);&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt; 124:  &lt;/span&gt; &lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 125:  &lt;/span&gt;                &lt;span class="rem"&gt;// Complete the read operation, releasing the lock and deleting the message from the queue&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt; 126:  &lt;/span&gt;                fullAddress = baseAddress + relativeAddress + String.Format(&lt;span class="str"&gt;"/messages/{0}/{1}"&lt;/span&gt;, result.MessageId, result.LockToken);&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 127:  &lt;/span&gt;            }&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt; 128:  &lt;/span&gt;            webClient = &lt;span class="kwrd"&gt;new&lt;/span&gt; WebClient();&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 129:  &lt;/span&gt;            webClient.Headers[HttpRequestHeader.Authorization] = token;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt; 130:  &lt;/span&gt;            webClient.UploadData(fullAddress, &lt;span class="str"&gt;"DELETE"&lt;/span&gt;, &lt;span class="kwrd"&gt;new&lt;/span&gt; &lt;span class="kwrd"&gt;byte&lt;/span&gt;[0] { });&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 131:  &lt;/span&gt;        }&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt; 132:  &lt;/span&gt; &lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 133:  &lt;/span&gt;        [TestMethod]&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt; 134:  &lt;/span&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; DecodeJsonToTypeShouldAllowEasyExtractionOfProps()&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 135:  &lt;/span&gt;        {&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt; 136:  &lt;/span&gt; &lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;p&gt;&lt;span class="lnum"&gt; 137:  &lt;/span&gt;            &lt;span class="kwrd"&gt;string&lt;/span&gt; payload = &lt;span class="str"&gt;@"{"&lt;/span&gt;&lt;span class="str"&gt;"DeliveryCount"&lt;/span&gt;&lt;span class="str"&gt;":3,"&lt;/span&gt;&lt;span class="str"&gt;"LockToken"&lt;/span&gt;&lt;span class="str"&gt;":"&lt;/span&gt;&lt;span class="str"&gt;"4a1d4c96-9837-42a9-ad91-3ecf704eec40"&lt;/span&gt;&lt;span class="str"&gt;","&lt;/span&gt;&lt;span class="str"&gt;"LockedUntilUtc"&lt;/span&gt;&lt;span class="str"&gt;":"&lt;/span&gt;&lt;span class="str"&gt;"Thu, 19 Jan 2012 01:22:44 GMT"&lt;/span&gt;&lt;span class="str"&gt;",&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="str"&gt;                                    &lt;/span&gt;&lt;span class="str"&gt;"&lt;/span&gt;&lt;span class="str"&gt;"MessageId"&lt;/span&gt;&lt;span class="str"&gt;":"&lt;/span&gt;&lt;span class="str"&gt;"4a4fa2c7d87a40a7b799625b9de69e42"&lt;/span&gt;&lt;span class="str"&gt;","&lt;/span&gt;&lt;span class="str"&gt;"SequenceNumber"&lt;/span&gt;&lt;span class="str"&gt;":2,"&lt;/span&gt;&lt;span class="str"&gt;"TimeToLive"&lt;/span&gt;&lt;span class="str"&gt;":922337203685}"&lt;/span&gt;;&lt;/p&gt;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt; 138:  &lt;/span&gt; &lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 139:  &lt;/span&gt;            DataContractJsonSerializer serializer = &lt;span class="kwrd"&gt;new&lt;/span&gt; DataContractJsonSerializer(&lt;span class="kwrd"&gt;typeof&lt;/span&gt;(BrokerProperty));&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt; 140:  &lt;/span&gt; &lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 141:  &lt;/span&gt;            &lt;span class="kwrd"&gt;using&lt;/span&gt; (MemoryStream stream = &lt;span class="kwrd"&gt;new&lt;/span&gt; MemoryStream(Encoding.Unicode.GetBytes(payload)))&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt; 142:  &lt;/span&gt;            {&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 143:  &lt;/span&gt;                var result = (BrokerProperty)serializer.ReadObject(stream);&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt; 144:  &lt;/span&gt; &lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 145:  &lt;/span&gt;                Assert.IsNotNull(result.MessageId);&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt; 146:  &lt;/span&gt;            }&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 147:  &lt;/span&gt; &lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt; 148:  &lt;/span&gt;        }&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 149:  &lt;/span&gt; &lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt; 150:  &lt;/span&gt;        [DataContract]&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 151:  &lt;/span&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; BrokerProperty&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt; 152:  &lt;/span&gt;        {&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 153:  &lt;/span&gt;            [DataMember]&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt; 154:  &lt;/span&gt;            &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; DeliveryCount { get; set; }&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 155:  &lt;/span&gt;            [DataMember]&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt; 156:  &lt;/span&gt;            &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; LockToken { get; set; }&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 157:  &lt;/span&gt;            [DataMember]&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt; 158:  &lt;/span&gt;            &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; LockedUntilUtc { get; set; }&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 159:  &lt;/span&gt;            [DataMember]&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt; 160:  &lt;/span&gt;            &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; MessageId { get; set; }&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 161:  &lt;/span&gt;            [DataMember]&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt; 162:  &lt;/span&gt;            &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; SequenceNumber { get; set; }&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 163:  &lt;/span&gt;            [DataMember]&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt; 164:  &lt;/span&gt;            &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; TimeToLive { get; set; }&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 165:  &lt;/span&gt;        }&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt; 166:  &lt;/span&gt; &lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 167:  &lt;/span&gt; &lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt; 168:  &lt;/span&gt;        &lt;span class="rem"&gt;// Helper&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 169:  &lt;/span&gt;        &lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; GetBaseAddress()&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt; 170:  &lt;/span&gt;        {&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 171:  &lt;/span&gt;            &lt;span class="kwrd"&gt;return&lt;/span&gt; baseAddress = &lt;span class="str"&gt;"https://"&lt;/span&gt; + serviceNamespace + &lt;span class="str"&gt;"."&lt;/span&gt; + sbHostName + &lt;span class="str"&gt;"/"&lt;/span&gt;;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt; 172:  &lt;/span&gt;        }&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 173:  &lt;/span&gt; &lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt; 174:  &lt;/span&gt;        &lt;span class="rem"&gt;// Helper, warmly borrowed from Service Bus Management Sample :-)&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 175:  &lt;/span&gt;        &lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; GetToken(&lt;span class="kwrd"&gt;string&lt;/span&gt; issuerName, &lt;span class="kwrd"&gt;string&lt;/span&gt; issuerSecret)&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt; 176:  &lt;/span&gt;        {&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 177:  &lt;/span&gt;            var acsEndpoint = &lt;span class="str"&gt;"https://"&lt;/span&gt; + serviceNamespace + &lt;span class="str"&gt;"-sb."&lt;/span&gt; + acsHostName + &lt;span class="str"&gt;"/WRAPv0.9/"&lt;/span&gt;;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt; 178:  &lt;/span&gt; &lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 179:  &lt;/span&gt;            &lt;span class="rem"&gt;// Note that the realm used when requesting a token uses the HTTP scheme, even though&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt; 180:  &lt;/span&gt;            &lt;span class="rem"&gt;// calls to the service are always issued over HTTPS&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 181:  &lt;/span&gt;            var realm = &lt;span class="str"&gt;"http://"&lt;/span&gt; + serviceNamespace + &lt;span class="str"&gt;"."&lt;/span&gt; + sbHostName + &lt;span class="str"&gt;"/"&lt;/span&gt;;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt; 182:  &lt;/span&gt; &lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 183:  &lt;/span&gt;            NameValueCollection values = &lt;span class="kwrd"&gt;new&lt;/span&gt; NameValueCollection();&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt; 184:  &lt;/span&gt;            values.Add(&lt;span class="str"&gt;"wrap_name"&lt;/span&gt;, issuerName);&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 185:  &lt;/span&gt;            values.Add(&lt;span class="str"&gt;"wrap_password"&lt;/span&gt;, issuerSecret);&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt; 186:  &lt;/span&gt;            values.Add(&lt;span class="str"&gt;"wrap_scope"&lt;/span&gt;, realm);&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 187:  &lt;/span&gt; &lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt; 188:  &lt;/span&gt;            WebClient webClient = &lt;span class="kwrd"&gt;new&lt;/span&gt; WebClient();&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 189:  &lt;/span&gt;            &lt;span class="kwrd"&gt;byte&lt;/span&gt;[] response = webClient.UploadValues(acsEndpoint, values);&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt; 190:  &lt;/span&gt; &lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 191:  &lt;/span&gt;            &lt;span class="kwrd"&gt;string&lt;/span&gt; responseString = Encoding.UTF8.GetString(response);&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt; 192:  &lt;/span&gt; &lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 193:  &lt;/span&gt;            var responseProperties = responseString.Split(&lt;span class="str"&gt;'&amp;amp;'&lt;/span&gt;);&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt; 194:  &lt;/span&gt;            var tokenProperty = responseProperties[0].Split(&lt;span class="str"&gt;'='&lt;/span&gt;);&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 195:  &lt;/span&gt;            var token = Uri.UnescapeDataString(tokenProperty[1]);&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt; 196:  &lt;/span&gt; &lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 197:  &lt;/span&gt;            &lt;span class="kwrd"&gt;return&lt;/span&gt; &lt;span class="str"&gt;"WRAP access_token=\""&lt;/span&gt; + token + &lt;span class="str"&gt;"\""&lt;/span&gt;;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt; 198:  &lt;/span&gt;        }&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 199:  &lt;/span&gt; &lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt; 200:  &lt;/span&gt;    }&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 201:  &lt;/span&gt;    &lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt; 202:  &lt;/span&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;&lt;![CDATA[
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }]]&gt;&lt;/style&gt;&lt;img src="http://rickgaribay.net/aggbug/326.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Rick G. Garibay</dc:creator>
            <guid>http://rickgaribay.net/archive/2012/01/19/common-service-bus-queue-operations-with-the-rest-api.aspx</guid>
            <pubDate>Thu, 19 Jan 2012 16:23:08 GMT</pubDate>
            <comments>http://rickgaribay.net/archive/2012/01/19/common-service-bus-queue-operations-with-the-rest-api.aspx#feedback</comments>
            <wfw:commentRss>http://rickgaribay.net/comments/commentRss/326.aspx</wfw:commentRss>
            <trackback:ping>http://rickgaribay.net/services/trackbacks/326.aspx</trackback:ping>
        </item>
        <item>
            <title>NuCon 2012&amp;ndash;Feb 16th, Irvine, CA</title>
            <link>http://rickgaribay.net/archive/2012/01/16/nucon-2012ndashfeb-16th-irvine-ca.aspx</link>
            <description>&lt;p&gt;I’d like to pass on some details regarding an event I will be speaking on in Irvine, CA on February 16th.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.neudesic.com/nucon/" target="_blank"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: left; border-top: 0px; border-right: 0px; padding-top: 0px" title="NU_logo" border="0" alt="NU_logo" align="left" src="http://rickgaribay.net/Images/customcontent/Announcing-NuCon-2012_A361/NU_logo.png" width="158" height="105" /&gt;&lt;/a&gt;NuCon is a one day conference put on by my employer, &lt;a href="http://neudesic.com" target="_blank"&gt;Neudesic&lt;/a&gt; that features talks and content from fellow Neudesic colleagues like &lt;a href="https://twitter.com/#!/davidpallmann" target="_blank"&gt;David Pallmann&lt;/a&gt;, &lt;a href="https://twitter.com/#!/tedneward" target="_blank"&gt;Ted Neward&lt;/a&gt; and &lt;a href="https://twitter.com/#!/simonguest" target="_blank"&gt;Simon Guest&lt;/a&gt;, &lt;a href="http://www.neudesic.com/nucon/speakers.html" target="_blank"&gt;just to name a few&lt;/a&gt;. &lt;a href="http://www.neudesic.com/nucon/" target="_blank"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 10px; padding-left: 0px; padding-right: 0px; display: inline; float: right; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" align="right" src="http://rickgaribay.net/Images/customcontent/Announcing-NuCon-2012_A361/image.png" width="485" height="1043" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;As Irvine is Neudesic’s headquarters, the event provides a great opportunity to gain insight into the future of technology as seen by my fellow colleagues as well as providing pragmatic guidance that you can put to use the following day while networking with other Neudesic customers,  executive management, partners and thought leaders to help guide your strategy on making the most of the tremendous opportunities that the Microsoft platform and Neudesic products have to offer.&lt;/p&gt;  &lt;p&gt;In my talk, &lt;a href="http://www.neudesic.com/nucon/schedule.html" target="_blank"&gt;Hybrid Composition on the Microsoft Application Integration platform&lt;/a&gt;, I’ll share how organizations of all shapes and sizes can benefit from the improvement, automation and streamlining of their business operations through hybrid composition.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;em&gt;Abstract&lt;/em&gt;&lt;/strong&gt; &lt;a href="http://rickgaribay.net/Images/customcontent/Announcing-NuCon-2012_A361/image_3.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; margin: 10px; padding-left: 0px; padding-right: 0px; display: inline; float: right; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" align="right" src="http://rickgaribay.net/Images/customcontent/Announcing-NuCon-2012_A361/image_thumb.png" width="207" height="344" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;In today’s technology landscape, exposing key functional areas as traditional services or other means has become the norm for achieving agility and is a requirement for taking advantage of the dramatic improvements that modern middleware capabilities both on-premise and in the cloud provide. &lt;/p&gt;  &lt;p&gt;As organizations adapt to this new hybrid model, a shift from a homogenous, single product, big iron approach to heterogeneous, best in class, capability-driven model is necessary for realizing the benefits of service-orientation and enabling the composition of these services on-premise, in the cloud and behind the firewall without making big spending commitments on a product that may only meet some of these needs.&lt;/p&gt;  &lt;p&gt;The Microsoft platform offers a number of capabilities for achieving these goals across common Hosting, Workflow, Rules, EAI and Messaging workloads that allow you to choose the right capabilities for delivering your intended business outcomes.&lt;/p&gt;  &lt;p&gt;BizTalk Server 2010 and Windows Server AppFabric 1.1 provide a comprehensive middleware platform for developing, deploying, and managing composite enterprise capabilities on-premise and Windows Azure Service Bus and Access Control Service allow you to extend your investments beyond traditional trust and network boundaries making the cloud and other partner/vendor endpoints merely an extension of your enterprise. &lt;/p&gt;  &lt;p&gt;Come learn how Windows Server AppFabric, WCF, WF Services, BizTalk Server and Windows Azure can benefit your approach to building and supporting application services at enterprise scale while transcending traditional trust boundaries and enabling the hybrid enterprise.&lt;/p&gt;  &lt;p&gt;&lt;em&gt;&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;&lt;em&gt;&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;&lt;em&gt;&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;&lt;em&gt;&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;&lt;em&gt;&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;&lt;em&gt;&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;&lt;em&gt;&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;&lt;em&gt;&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;&lt;em&gt;&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;&lt;em&gt;&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;&lt;em&gt;To give you an idea of the breadth and depth of the sessions, in my talk, I’ll be talking about and showing live demos of the latest capabilities that enable you to build hybrid composite solutions to drive differentiation and innovation within your organization:&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Windows Server AppFabric 1.1 Caching (On-Prem) Featuring:&lt;/strong&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;AppFabric distributed caching including implementing the Cache-Aside caching pattern and Read-Through caching, new in AppFabric 1.1  &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;strong&gt;WF 4 Workflow Services (On-Prem) Featuring:&lt;/strong&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;State Machine Activity, new in .NET 4.1 and .NET 4.5  &lt;/li&gt;    &lt;li&gt;AppFabric Connect BizTalk Mapper for WF 4 in AppFabric Connect &lt;/li&gt;    &lt;li&gt;Long-running workflows &lt;/li&gt;    &lt;li&gt;Workflow Correlation &lt;/li&gt;    &lt;li&gt;Composition with WCF services in Windows Azure      &lt;br /&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;strong&gt;Windows Server AppFabric Deployment (On-Prem) Featuring:&lt;/strong&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Easy deployment with Microsoft Web Deploy &lt;/li&gt;    &lt;li&gt;Windows Server AppFabric Configuration Experience &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;strong&gt;WCF hosting in Windows Azure Web Roles (Cloud) Featuring:&lt;/strong&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Azure Web Role hosting &lt;/li&gt;    &lt;li&gt;Azure Service Bus Topic client &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;strong&gt;Azure Service Bus Brokered Messaging (Hybrid) Featuring:&lt;/strong&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Brokered messaging from Azure to on-premise custom applications behind the firewall &lt;/li&gt;    &lt;li&gt;Topics and Subscriptions &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;strong&gt;BizTalk Server 2010 Orchestration &amp;amp; Messaging (On-Prem) Featuring:&lt;/strong&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Custom WCF Adapter for consuming messages off an Azure Service Bus Topic &lt;/li&gt;    &lt;li&gt;Support for custom WCF behaviors &lt;/li&gt;    &lt;li&gt;Support for hybrid ERP integration such as Dynamics CRM or SAP &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;So, if you are interested in attending, please consider yourself invited! Click on the links in the invitation below to register (save $100 if you register before Feb 1) and I look forward to seeing you at NuCon 12!&lt;/p&gt;&lt;img src="http://rickgaribay.net/aggbug/325.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Rick G. Garibay</dc:creator>
            <guid>http://rickgaribay.net/archive/2012/01/16/nucon-2012ndashfeb-16th-irvine-ca.aspx</guid>
            <pubDate>Mon, 16 Jan 2012 19:44:34 GMT</pubDate>
            <comments>http://rickgaribay.net/archive/2012/01/16/nucon-2012ndashfeb-16th-irvine-ca.aspx#feedback</comments>
            <wfw:commentRss>http://rickgaribay.net/comments/commentRss/325.aspx</wfw:commentRss>
            <trackback:ping>http://rickgaribay.net/services/trackbacks/325.aspx</trackback:ping>
        </item>
        <item>
            <title>Azure Service Bus Connect EAI and EDI &amp;ldquo;Integration Services&amp;rdquo; CTP</title>
            <link>http://rickgaribay.net/archive/2011/12/16/azure-service-bus-connect-eai-and-edi-ldquointegration-servicesrdquo-ctp.aspx</link>
            <description>&lt;p&gt;I am thrilled to share in the &lt;a href="http://blogs.msdn.com/b/windowsazure/archive/2011/12/16/announcing-the-service-bus-eai-amp-edi-labs-release.aspx" target="_blank"&gt;announcement&lt;/a&gt; that the first public CTP of Azure Service Bus Integration Services&lt;strong&gt; is now LIVE&lt;/strong&gt; at &lt;a href="http://portal.appfabriclabs.com"&gt;http://portal.appfabriclabs.com&lt;/a&gt;. &lt;/p&gt;  &lt;p&gt;The focus of this release is to enable you to build hybrid composite solutions that span on-premise investments such as Microsoft SQL Server, Oracle Database, SAP, Siebel eBusiness Applications, Oracle E-Business Suite, allowing you to compose these mission critical systems with applications, assets and workloads that you have deployed to Windows Azure, enabling first-class hybrid integration across traditional network and trust boundaries. &lt;/p&gt;  &lt;p&gt;In a web to web world, many of the frictions addressed in these capabilities still exist, albeit to a smaller degree. The reality is that as the web and cloud computing continue to gain momentum, investments on-premise are, and will continue to be critical to realizing the full spectrum of benefits that cloud computing provides both in the short and long term. &lt;/p&gt;  &lt;p&gt;So, what’s in this CTP?&lt;/p&gt;  &lt;p&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/windowsazure/hh689889.aspx" target="_blank"&gt;Azure Service Bus Connect&lt;/a&gt; provides a new server explorer experience for LOB integration exposing a management head that can be accessed on-prem via Server Explorer or PowerShell to create, update, delete or retrieve information from LOB targets. This provides a robust extension of the Azure Service Bus relay endpoint concept, which acts a LOB conduit (LobTarget, LobRelay) for bridging these assets by extending the WCF LOB Adapters that ship with BizTalk Server 2010. The beauty of this approach is that you can leverage the LOB Adapters using BizTalk as a host, or, for a lighter weight way approach, use IIS/Windows Server AppFabric to compose business operations on-premise and beyond. &lt;/p&gt;  &lt;p&gt;In addition, support for messaging between trading partners across traditional trust boundaries in business-to-business (B2B) scenarios using is EDI is also provided in this preview, including AS2 protocol support with X12 chaining for send and receive pipelines, FTP as transport for X12, agreement templates, partners view with profiles per partner, resources view, and an intuitive, metro style &lt;a href="http://i.msdn.microsoft.com/dynimg/IC553343.gif"&gt;EDI Portal&lt;img style="display: inline; float: right" title="Transforms Project Design Surface" alt="Transforms Project Design Surface" align="right" src="http://i.msdn.microsoft.com/dynimg/IC553343.gif" width="240" height="165" /&gt;&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;Just as with on-premise integration, friction always exists when integrating different assets which may exist on different platforms, implement different standards and at a minimum have different representations of common entities that are part of your composite solution’s domain. What is needed is a mediation broker that can be leveraged at internet-scale, and apply message and protocol transformations across disparate parties and this is exactly what the &lt;a href="http://msdn.microsoft.com/en-us/library/windowsazure/hh689905.aspx" target="_blank"&gt;Transforms&lt;/a&gt; capability provides. Taking an approach that will be immediately familiar to the BizTalk developer, a familiar mapper-like experience is provided within Visual Studio for interactively mapping message elements and applying additional processing logic via operations (functoids).&lt;/p&gt;  &lt;p&gt;In addition, &lt;a href="http://msdn.microsoft.com/en-us/library/windowsazure/hh689768.aspx" target="_blank"&gt;XML Bridges&lt;/a&gt; which include the XML One-Way Bridge and XML Request-Reply Bridge are an extension to the Azure Service Bus which supports critical patterns such as protocol bridging, routing actions, external data lookup for message enrichment and support for both WS-I and REST endpoints and any combination thereof.&lt;/p&gt;  &lt;p&gt;As shown below in the MSDN documentation, “bridges are composed of stages and activities where each stage is a message processing unit in itself. Each stage of a bridge is atomic, which means either a message completes a stage or not. A stage can be turned &lt;em&gt;on&lt;/em&gt; or &lt;em&gt;off&lt;/em&gt;, indicating whether to process a message or simply let it &lt;em&gt;pass through”&lt;/em&gt;.&lt;/p&gt;  &lt;p&gt;&lt;img style="margin: 0px 10px 0px 0px; display: inline; float: left" title="Stages of a bridge" alt="Stages of a bridge" align="left" src="http://i.msdn.microsoft.com/dynimg/IC551928.gif" /&gt;&lt;/p&gt;  &lt;p&gt;Taking a familiar VETR approach to validate, extract, transform and route messages from one party to another, along with the ability to enrich messages by composing other endpoint in-flight (supported protocols include HTTP, WS-HTTP and Basic HTTP, HTTP Relay Endpoint, Service Bus Queues/Topics and any other XML bridge) the Bridge is a very important capability and brings very robust capabilities for extending Azure Service Bus as a key messaging broker across integration disciplines. &lt;/p&gt;  &lt;p&gt;In reality, these patterns have no more to do with EAI than with traditional, contemporary service composition and become necessary once you move from a point-to-point approach and need to elegantly manage integration and composition across assets. As such, this capability acts as a bridge to Azure Service Bus that is very powerful in and of itself, even in non-EAI/EDI scenarios where endpoints can be virtualized increasing decoupling between parties (clients/services). In addition, this capability further enriches what is possible when using the BrokeredMessage property construct as a potential poor-man’s routing mechanism.   &lt;br /&gt;&lt;/p&gt;  &lt;p&gt;In closing, the need to address the impedance mismatch that exists between disparate applications that must communicate with each other is a friction that will continue to exist for many years to come, and while traditionally, many of these problems have been solved by expensive, big iron middleware servers, this is changing. &lt;/p&gt;  &lt;p&gt;As with most technologies, often new possibilities are unlocked that are residual side-effects of something bigger, and this is certainly the case with how both &lt;a href="http://www.code-magazine.com/Article.aspx?quickid=1112041" target="_blank"&gt;innovative&lt;/a&gt; &lt;a href="http://www.code-magazine.com/Article.aspx?quickid=1112041" target="_blank"&gt;and strategic Azure Service Bus is to Microsoft’s PaaS strategy&lt;/a&gt;. Azure Service Bus continues to serve as a great example of a welcomed shift to a lightweight capability-based, platform-oriented approach to solving tough distributed messaging/integration problems while honoring the existing investments that organizations have made and benefiting from a common platform approach which is extremely unique in the market. And while this shift will take some time, in the long-run enterprises of all shapes and sizes only stand to benefit.&lt;/p&gt;  &lt;p&gt;To get started, download the SDK &amp;amp; samples from &lt;a href="http://go.microsoft.com/fwlink/?LinkID=184288"&gt;http://go.microsoft.com/fwlink/?LinkID=184288&lt;/a&gt; and the tutorial &amp;amp; documentation from &lt;a href="http://go.microsoft.com/fwlink/?LinkID=235197"&gt;http://go.microsoft.com/fwlink/?LinkID=235197&lt;/a&gt; and watch this and the &lt;a href="http://blogs.msdn.com/b/windowsazure/" target="_blank"&gt;Windows Azure&lt;/a&gt; blog for more details coming soon.&lt;/p&gt;  &lt;p&gt;Happy Messaging!&lt;/p&gt;&lt;img src="http://rickgaribay.net/aggbug/324.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Rick G. Garibay</dc:creator>
            <guid>http://rickgaribay.net/archive/2011/12/16/azure-service-bus-connect-eai-and-edi-ldquointegration-servicesrdquo-ctp.aspx</guid>
            <pubDate>Fri, 16 Dec 2011 18:46:51 GMT</pubDate>
            <comments>http://rickgaribay.net/archive/2011/12/16/azure-service-bus-connect-eai-and-edi-ldquointegration-servicesrdquo-ctp.aspx#feedback</comments>
            <slash:comments>2</slash:comments>
            <wfw:commentRss>http://rickgaribay.net/comments/commentRss/324.aspx</wfw:commentRss>
            <trackback:ping>http://rickgaribay.net/services/trackbacks/324.aspx</trackback:ping>
        </item>
        <item>
            <title>DCC 2011.2 Lap Around Azure Service Bus: The Goods</title>
            <link>http://rickgaribay.net/archive/2011/11/05/dcc-2011.2-lap-around-azure-service-bus-the-goods.aspx</link>
            <description>&lt;p&gt;Thanks to all that came out to my “&lt;a href="http://nov2011.desertcodecamp.com/session/430" target="_blank"&gt;Lap Around Azure Service Bus Brokered Messaging&lt;/a&gt;” talk at Desert Code Camp today. &lt;/p&gt;  &lt;p&gt;We covered a ton of content including things a few folks didn’t know about relay messaging capabilities in Azure Service Bus and demonstrated how simple it is to expose a REST or SOAP endpoint from behind the firewall. I also demonstrated the brand new load balancing capabilities that were just released last week. &lt;/p&gt;  &lt;p&gt;From there, we dove deep into the .NET API to walk through how to provision queues and topics from code and start messaging within minutes by simply grabbing the Azure Service Bus NuGet package and writing a few lines of code.&lt;iframe height="327" src="http://r.office.microsoft.com/r/rlidPowerPointEmbed?p1=1&amp;amp;p2=1&amp;amp;p3=SDDF930EE6F91132FD!422&amp;amp;p4=&amp;amp;kip=1" frameborder="0" width="402" scrolling="no" align="right"&gt;&lt;/iframe&gt;&lt;/p&gt;  &lt;p&gt;Next, we explored the REST API, and how simple it is for any HTTP client, regardless of platform to take advantage of the robust messaging capabilities that Azure Service Bus queues and topics have to offer.&lt;/p&gt;  &lt;p&gt;Last but not least, we wrapped up with a quick walkthrough of the NeMessagingBinding and how simple it is to send and receive messages over a queue using the familiar WCF programming model.&lt;/p&gt;  &lt;p&gt;I hope that each of you will unlock new possibilities with the power that these hybrid messaging capabilities have to offer. &lt;/p&gt;  &lt;p&gt;I’d also like to thank &lt;a href="http://www.pluralsight-training.net/microsoft/" target="_blank"&gt;Pluralsight&lt;/a&gt; for sponsoring my session. The &lt;a href="http://twitter.com/#!/search/realtime/%23dcc11%20%23Azure%20%23ServiceBus%20%23Q1" target="_blank"&gt;quiz is now up&lt;/a&gt; for the first 5 smartest attendees. &lt;/p&gt;  &lt;p&gt;Search for hashtags &lt;a href="http://twitter.com/#!/search/realtime/%23dcc11%20%23Azure%20%23ServiceBus%20%23Q2" target="_blank"&gt;#dcc11 #Azure #ServiceBus #Q1 to #Q5.&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Good Luck! &lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;table border="0" cellspacing="0" cellpadding="2" width="229"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="middle" width="91"&gt;&lt;strong&gt;Code Demos&lt;/strong&gt;&lt;/td&gt;        &lt;td valign="middle" width="136"&gt;&lt;iframe style="padding-bottom: 0px; background-color: #fcfcfc; padding-left: 0px; width: 98px; padding-right: 0px; height: 115px; padding-top: 0px" title="Preview" marginheight="0" src="https://skydrive.live.com/embedicon.aspx/Public/Talks/DCC%202011.2?cid=df930ee6f91132fd&amp;amp;sc=documents" frameborder="0" marginwidth="0" scrolling="no" align="right"&gt;&lt;/iframe&gt;&lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;Happy Messaging!&lt;/p&gt;&lt;img src="http://rickgaribay.net/aggbug/323.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Rick G. Garibay</dc:creator>
            <guid>http://rickgaribay.net/archive/2011/11/05/dcc-2011.2-lap-around-azure-service-bus-the-goods.aspx</guid>
            <pubDate>Sat, 05 Nov 2011 21:33:25 GMT</pubDate>
            <comments>http://rickgaribay.net/archive/2011/11/05/dcc-2011.2-lap-around-azure-service-bus-the-goods.aspx#feedback</comments>
            <wfw:commentRss>http://rickgaribay.net/comments/commentRss/323.aspx</wfw:commentRss>
            <trackback:ping>http://rickgaribay.net/services/trackbacks/323.aspx</trackback:ping>
        </item>
        <item>
            <title>Azure AppFabric Service Bus Brokered Messaging GA &amp;amp; Rude CTP Diffs</title>
            <link>http://rickgaribay.net/archive/2011/09/14/azure-appfabric-service-bus-brokered-messaging-ga-amp-rude-ctp.aspx</link>
            <description>&lt;p&gt;Today at the Build conference in Anaheim California, Satya Nadella, President Server and Tools business announced general availability of the production release of AppFabric Queues and Topics, otherwise known as Brokered Messaging.&lt;/p&gt;  &lt;p&gt;Brokered Messaging introduces durable queue capabilities and rich, durable pub-sub with topics and subscriptions that compliment the existing Relayed Messaging capabilities.  &lt;/p&gt;  &lt;p&gt;I covered Brokered Messaging following the &lt;a href="http://rickgaribay.net/archive/2011/05/17/appfabric-service-bus-v2-ctp.aspx" target="_blank"&gt;May CTP release&lt;/a&gt; of &lt;a href="http://rickgaribay.net/archive/2011/05/17/appfabric-service-bus-v2-ctp.aspx" target="_blank"&gt;Queues&lt;/a&gt; and followed up shortly with an overview and exploration of &lt;a href="http://rickgaribay.net/archive/2011/05/31/exploring-appfabric-service-bus-v2-may-ctp-topics.aspx" target="_blank"&gt;Topics&lt;/a&gt; (please see some other great resources at the end of this post).&lt;/p&gt;  &lt;p&gt;Since then, there was a June CTP release which included the new AppFabric Application and no visible changes to Brokered Messaging, however since its release, the AppFabric Messaging team has been hard at work refining the API and behaviors based on feedback from Advisors, MVPs and the community at large. &lt;/p&gt;  &lt;p&gt;Since I’ve already covered Queues and Topics in the aforementioned posts, I’ll dive right in to some terse examples which demonstrate the API changes. Though not an exhaustive review of all of the changes, I’ve covered the types that your most likely to come across and will cover Queues, Topics and Subscriptions extensively in my upcoming article in &lt;a href="http://www.code-magazine.com/SearchResults.aspx?search=garibay" target="_blank"&gt;CODE Magazine&lt;/a&gt; which will also include more in-depth walk-throughs of the .NET Client API, REST API and WCF scenarios.&lt;/p&gt;  &lt;p&gt;Those of you who have worked with the CTPs will find some subtle and not so subtle changes, but all in all I think all of the refinements are for the best and I think you’ll appreciate them as I have. For those new to Azure AppFabric Service Bus Brokered Messaging, you’ll benefit most from reading my first two posts based on the May CTP (or any of the resources at the end of this post) to get an idea of the why behind queues and topics and then come back here to explore the what and how.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;font size="3"&gt;A Quick Note on Versioning&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;In the CTPs that preceded the release of the new Azure AppFabric Service Bus features, a temporary assembly called “Microsoft.ServiceBus.Messaging.dll” was added to serve a container for new features and deltas that were introduced during the development cycle. The final release includes a single assembly called “Microsoft.ServiceBus.dll” which contains all of the existing relay capabilities that you’re already familiar with as well as the addition of support for queues and topics. If you are upgrading from the CTPs, you’ll want to get ahold of the new Microsoft.ServiceBus.dll version 1.5 which includes everything plus the new queue and topic features.&lt;/p&gt;  &lt;p&gt;The new 1.5 version of the Microsoft.ServiceBus.dll assembly targets the .NET 4.0 framework. Customers using .NET 3.5 can continue using the existing Microsoft.ServiceBus.dll  assembly (version 1.0.1123.2) for leveraging the relay capabilities, but must upgrade to .NET 4.0 to take advantage of the latest features presented here.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;font size="4"&gt;.NET Client API&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;font size="3"&gt;Queues&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;table border="1" cellspacing="0" cellpadding="2" width="1072"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="251"&gt;&lt;strong&gt;May/June CTP&lt;/strong&gt;&lt;/td&gt;        &lt;td valign="top" width="251"&gt;&lt;strong&gt;General Availability&lt;/strong&gt;&lt;/td&gt;        &lt;td valign="top" width="568"&gt;&lt;strong&gt;Comments&lt;/strong&gt;&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="251"&gt;ServiceBusNamespaceClientSettings&lt;/td&gt;        &lt;td valign="top" width="251"&gt;NamespaceManagerSettings&lt;/td&gt;        &lt;td valign="top" width="568"&gt;New class for encapsulating endpoint and security settings.&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="251"&gt;N/A&lt;/td&gt;        &lt;td valign="top" width="251"&gt;TokenProvider&lt;/td&gt;        &lt;td valign="top" width="568"&gt;New class for acquiring a WRAP token from ACS.&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="251"&gt;ServiceBusNamespaceClient&lt;/td&gt;        &lt;td valign="top" width="251"&gt;NamespaceManager&lt;/td&gt;        &lt;td valign="top" width="568"&gt;Root management object for creating Queues, Topics, Subscriptions.&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="251"&gt;Queue&lt;/td&gt;        &lt;td valign="top" width="251"&gt;QueueDescription&lt;/td&gt;        &lt;td valign="top" width="568"&gt;In May/June CTP, Topic / Queue / Subscription were management objects. All create/delete operations were moved to NamespaceManager and the state operations are now on TopicDescription/QueueDescription etc.&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="251"&gt;MessagingFactorySettings&lt;/td&gt;        &lt;td valign="top" width="251"&gt;MessagingFactorySettings&lt;/td&gt;        &lt;td valign="top" width="568"&gt;New class for encapsulating security settings.&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="251"&gt;MessagingFactory&lt;/td&gt;        &lt;td valign="top" width="251"&gt;MessagingFactory&lt;/td&gt;        &lt;td valign="top" width="568"&gt; &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="251"&gt;BrokeredMessage&lt;/td&gt;        &lt;td valign="top" width="251"&gt;BrokeredMessage&lt;/td&gt;        &lt;td valign="top" width="568"&gt;No longer a factory. Simply instantiate a BrokeredMessage.&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="251"&gt;MessageSender&lt;/td&gt;        &lt;td valign="top" width="251"&gt;MessageSender&lt;/td&gt;        &lt;td valign="top" width="568"&gt;Optional, for use when you want to abstract away queue or topic.&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="251"&gt;MessageReceiver&lt;/td&gt;        &lt;td valign="top" width="251"&gt;MessageReceiver&lt;/td&gt;        &lt;td valign="top" width="568"&gt;Optional, for use when you want to abstract away queue or topic.&lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Below is a representative sample for creating, configuring, sending and receiving a message on a queue:&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Administrative Operations&lt;/strong&gt;&lt;/p&gt;  &lt;pre style="border-bottom: #cecece 1px solid; border-left: #cecece 1px solid; padding-bottom: 5px; background-color: #fbfbfb; min-height: 40px; padding-left: 5px; width: 817px; padding-right: 5px; height: 397px; overflow: auto; border-top: #cecece 1px solid; border-right: #cecece 1px solid; padding-top: 5px"&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;  1: 
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;  2:             &lt;span style="color: #008000"&gt;// Configure and create NamespaceManager for performing administrative operations&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;  3:             NamespaceManagerSettings settings = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; NamespaceManagerSettings();
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;  4:             TokenProvider tokenProvider = settings.TokenProvider = TokenProvider.CreateSharedSecretTokenProvider(issuer,key);
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;  5:             
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;  6:             NamespaceManager manager = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; NamespaceManager(ServiceBusEnvironment.CreateServiceUri("&lt;span style="color: #8b0000"&gt;sb&lt;/span&gt;", serviceNamespace, &lt;span style="color: #0000ff"&gt;string&lt;/span&gt;.Empty), settings);
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;  7: 
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;  8:             &lt;span style="color: #008000"&gt;// Check for existence of queues on the fabric&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;  9:             var qs = manager.GetQueues();
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 10: 
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 11:             var result = from q &lt;span style="color: #0000ff"&gt;in&lt;/span&gt; qs
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 12:                          where q.Path.Equals(queueName, StringComparison.OrdinalIgnoreCase)
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 13:                          select q;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 14: 
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 15:             &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (result.Count() == 0)
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 16:             {
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 17:                 Console.WriteLine("&lt;span style="color: #8b0000"&gt;Queue does not exist&lt;/span&gt;");
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 18: 
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 19:                 &lt;span style="color: #008000"&gt;// Create Queue&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 20:                 Console.WriteLine("&lt;span style="color: #8b0000"&gt;Creating Queue...&lt;/span&gt;");
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 21: 
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 22:                 manager.CreateQueue(&lt;span style="color: #0000ff"&gt;new&lt;/span&gt; QueueDescription(queueName) { LockDuration = TimeSpan.FromSeconds(5.0d) });
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 23:                 
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 24:             }&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;Runtime Operations&lt;/strong&gt;&lt;/p&gt;

&lt;pre style="border-bottom: #cecece 1px solid; border-left: #cecece 1px solid; padding-bottom: 5px; background-color: #fbfbfb; min-height: 40px; padding-left: 5px; width: 815px; padding-right: 5px; height: 716px; overflow: auto; border-top: #cecece 1px solid; border-right: #cecece 1px solid; padding-top: 5px"&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;  1:             &lt;span style="color: #008000"&gt;// Create and Configure Messaging Factory to provision QueueClient&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;  2:             MessagingFactorySettings messagingFactorySettings = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; MessagingFactorySettings();
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;  3:             messagingFactorySettings.TokenProvider = settings.TokenProvider = TokenProvider.CreateSharedSecretTokenProvider(issuer, key);
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;  4:             MessagingFactory messagingFactory = MessagingFactory.Create(ServiceBusEnvironment.CreateServiceUri("&lt;span style="color: #8b0000"&gt;sb&lt;/span&gt;", serviceNamespace, &lt;span style="color: #0000ff"&gt;string&lt;/span&gt;.Empty), messagingFactorySettings);
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;  5:             
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;  6:             QueueClient queueClient = messagingFactory.CreateQueueClient(queueName, ReceiveMode.PeekLock);
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;  7: 
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;  8:             Order order = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Order();
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;  9:             order.OrderId = 42;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 10:             order.Products.Add("&lt;span style="color: #8b0000"&gt;Kinect&lt;/span&gt;", 70.50M);
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 11:             order.Products.Add("&lt;span style="color: #8b0000"&gt;XBOX 360&lt;/span&gt;", 199.99M);
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 12:             order.Total = order.Products["&lt;span style="color: #8b0000"&gt;Kinect&lt;/span&gt;"] + order.Products["&lt;span style="color: #8b0000"&gt;XBOX 360&lt;/span&gt;"];
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 13: 
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 14:             &lt;span style="color: #008000"&gt;// Create a Brokered Message from the Order object&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 15:             BrokeredMessage msg = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; BrokeredMessage(order);
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 16: 
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 17:             &lt;span style="color: #008000"&gt;/***********************
&lt;/span&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 18:             *** Send Operations  ***
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 19:             ************************/
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 20: 
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 21:             queueClient.Send(msg);
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 22: 
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 23:             &lt;span style="color: #008000"&gt;/**************************
&lt;/span&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 24:              *** Receive Operations ***
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 25:             ***************************/
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 26:             
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 27:             BrokeredMessage recdMsg;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 28:             Order recdOrder;
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 29: 
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 30:             &lt;span style="color: #008000"&gt;// Receive and lock message&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 31:             recdMsg = queueClient.Receive();
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 32: 
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 33:             &lt;span style="color: #0000ff"&gt;if&lt;/span&gt;(recdMsg != &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;)
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 34:             {
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 35:                 &lt;span style="color: #008000"&gt;// Convert from BrokeredMessage to native Order&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 36:                 recdOrder = recdMsg.GetBody&amp;lt;Order&amp;gt;();
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 37: 
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 38:                 Console.ForegroundColor = ConsoleColor.Green;
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 39:                 Console.WriteLine("&lt;span style="color: #8b0000"&gt;Received Order {0} \n\t with Message Id {1} \n\t and Lock Token:{2} \n\t from {3} \n\t with total of ${4}&lt;/span&gt;", recdOrder.OrderId, recdMsg.MessageId, recdMsg.LockToken, "&lt;span style="color: #8b0000"&gt;Receiver 1&lt;/span&gt;", recdOrder.Total);
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 40:                 recdMsg.Complete();
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 41:             }
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 42:             queueClient.Close();&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;Note that MessageSender and MessageReceiver are now optional. Here’s an example that shows PeekLocking a message, simulating an exception and trying again:&lt;/p&gt;

&lt;pre style="border-bottom: #cecece 1px solid; border-left: #cecece 1px solid; padding-bottom: 5px; background-color: #fbfbfb; min-height: 40px; padding-left: 5px; width: 828px; padding-right: 5px; height: 533px; overflow: auto; border-top: #cecece 1px solid; border-right: #cecece 1px solid; padding-top: 5px"&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;  1: 
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;  2:             &lt;span style="color: #008000"&gt;// Alternate receive approach using agnostic MessageReceiver&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;  3:             MessageReceiver receiver = messagingFactory.CreateMessageReceiver(queueName);            &lt;span style="color: #008000"&gt;// Recieve, complete, and delete message from the fabric&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;  4: 
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;  5:             &lt;span style="color: #0000ff"&gt;try&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;  6:             {
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;  7:                 &lt;span style="color: #008000"&gt;// Receive and lock message&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;  8:                 recdMsg = receiver.Receive();
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;  9: 
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 10:                 &lt;span style="color: #008000"&gt;// Convert from BrokeredMessage to native Order&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 11:                 recdOrder = recdMsg.GetBody&amp;lt;Order&amp;gt;();
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 12: 
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 13:                 &lt;span style="color: #008000"&gt;// Complete read, release and delete message from the fabric&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 14:                 receiver.Complete(recdMsg.LockToken);
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 15: 
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 16:                 Console.ForegroundColor = ConsoleColor.Green;
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 17:                 Console.WriteLine("&lt;span style="color: #8b0000"&gt;Received Order {0} \n\t with Message Id {1} \n\t and Lock Token:{2} \n\t from {3} \n\t with total of ${4} \n\t at {5}&lt;/span&gt;", recdOrder.OrderId, recdMsg.MessageId, recdMsg.LockToken, "&lt;span style="color: #8b0000"&gt;Receiver 2&lt;/span&gt;", recdOrder.Total, DateTime.Now.Hour + "&lt;span style="color: #8b0000"&gt;:&lt;/span&gt;" + DateTime.Now.Minute + "&lt;span style="color: #8b0000"&gt;:&lt;/span&gt;" + DateTime.Now.Second);
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 18:             }
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 19:             &lt;span style="color: #0000ff"&gt;catch&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 20:             {
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 21:                 &lt;span style="color: #008000"&gt;// Should processing fail, release the lock from the fabric and make message available for later processing.&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 22:                 &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (recdMsg != &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;)
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 23:                 {
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 24:                     receiver.Abandon(recdMsg.LockToken);
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 25:                     
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 26:                     Console.ForegroundColor = ConsoleColor.Red;
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 27:                     Console.WriteLine("&lt;span style="color: #8b0000"&gt;Message could not be processed.&lt;/span&gt;");
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 28: 
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 29:                 }
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 30:             }
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 31:             &lt;span style="color: #0000ff"&gt;finally&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 32:             {
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 33:                 receiver.Close();
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 34:             }&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;As shown below, this sample results in order 42 being received by the QueueClient:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://rickgaribay.net/images/rickgaribay_net/Windows-Live-Writer/AppFabric-Service-Bus-Queues--Topics-Rel_D1C0/image_2.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; margin: 2px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://rickgaribay.net/images/rickgaribay_net/Windows-Live-Writer/AppFabric-Service-Bus-Queues--Topics-Rel_D1C0/image_thumb.png" width="807" height="127" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;br /&gt;

&lt;p&gt;&lt;strong&gt;&lt;font size="3"&gt;Topics&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;table border="1" cellspacing="0" cellpadding="0"&gt;&lt;tbody&gt;
    &lt;tr&gt;
      &lt;td valign="top" width="268"&gt;
        &lt;p&gt;&lt;b&gt;May/June CTP&lt;/b&gt;&lt;/p&gt;
      &lt;/td&gt;

      &lt;td valign="top" width="239"&gt;
        &lt;p&gt;&lt;b&gt;General Availability&lt;/b&gt;&lt;/p&gt;
      &lt;/td&gt;

      &lt;td valign="top" width="566"&gt;
        &lt;p&gt;&lt;b&gt;Comments&lt;/b&gt;&lt;/p&gt;
      &lt;/td&gt;
    &lt;/tr&gt;

    &lt;tr&gt;
      &lt;td valign="top" width="268"&gt;
        &lt;p&gt;Topic&lt;/p&gt;
      &lt;/td&gt;

      &lt;td valign="top" width="239"&gt;
        &lt;p&gt;TopicDescription&lt;/p&gt;
      &lt;/td&gt;

      &lt;td valign="top" width="566"&gt;
        &lt;p&gt;In May/June CTP, Topic / Queue / Subscription were management objects. All create/delete operations were moved to NamespaceManager and the state operations are now on TopicDescription/QueueDescription etc.&lt;/p&gt;
      &lt;/td&gt;
    &lt;/tr&gt;

    &lt;tr&gt;
      &lt;td valign="top" width="268"&gt;
        &lt;p&gt;TopicClient&lt;/p&gt;
      &lt;/td&gt;

      &lt;td valign="top" width="239"&gt;
        &lt;p&gt;TopicClient&lt;/p&gt;
      &lt;/td&gt;

      &lt;td valign="top" width="566"&gt;
        &lt;p&gt;As noted in the Queues section, you can use TopicClient or MessageSender in the event you want to abstract details of using Topics.&lt;/p&gt;
      &lt;/td&gt;
    &lt;/tr&gt;

    &lt;tr&gt;
      &lt;td valign="top" width="268"&gt;
        &lt;p&gt;SubscriptionClient&lt;/p&gt;
      &lt;/td&gt;

      &lt;td valign="top" width="239"&gt;
        &lt;p&gt;SubscriptionClient&lt;/p&gt;
      &lt;/td&gt;

      &lt;td valign="top" width="566"&gt;
        &lt;p&gt;As noted in the Queues section, you can use SubscriptionClient or MessageReceiver in the event you want to abstract details of using a Topic/Subscription.&lt;/p&gt;
      &lt;/td&gt;
    &lt;/tr&gt;

    &lt;tr&gt;
      &lt;td valign="top" width="268"&gt;
        &lt;p&gt;Subscription&lt;/p&gt;
      &lt;/td&gt;

      &lt;td valign="top" width="239"&gt;
        &lt;p&gt;SubscriptionDescription&lt;/p&gt;
      &lt;/td&gt;

      &lt;td valign="top" width="566"&gt;Changes to constructors and use of properties (see code samples below), but intent is the same.&lt;/td&gt;
    &lt;/tr&gt;

    &lt;tr&gt;
      &lt;td valign="top" width="268"&gt;
        &lt;p&gt;RuleDescription&lt;/p&gt;
      &lt;/td&gt;

      &lt;td valign="top" width="239"&gt;
        &lt;p&gt;RuleDescription&lt;/p&gt;
      &lt;/td&gt;

      &lt;td valign="top" width="566"&gt;Changes to constructors and use of properties (see code samples below), but intent is the same.&lt;/td&gt;
    &lt;/tr&gt;

    &lt;tr&gt;
      &lt;td valign="top" width="268"&gt;
        &lt;p&gt;FilterExpression&lt;/p&gt;
      &lt;/td&gt;

      &lt;td valign="top" width="239"&gt;
        &lt;p&gt;Filter&lt;/p&gt;
      &lt;/td&gt;

      &lt;td valign="top" width="566"&gt;
        &lt;p&gt;Base for Filter types such as SqlFilter&lt;/p&gt;
      &lt;/td&gt;
    &lt;/tr&gt;

    &lt;tr&gt;
      &lt;td valign="top" width="268"&gt;
        &lt;p&gt;SqlFilterExpression&lt;/p&gt;
      &lt;/td&gt;

      &lt;td valign="top" width="239"&gt;
        &lt;p&gt;SqlFilter&lt;/p&gt;
      &lt;/td&gt;

      &lt;td valign="top" width="566"&gt; &lt;/td&gt;
    &lt;/tr&gt;

    &lt;tr&gt;
      &lt;td valign="top" width="268"&gt;
        &lt;p&gt;FilterAction&lt;/p&gt;
      &lt;/td&gt;

      &lt;td valign="top" width="239"&gt;
        &lt;p&gt;RuleAction&lt;/p&gt;
      &lt;/td&gt;

      &lt;td valign="top" width="566"&gt; &lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;&lt;/table&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;Below is a representative sample for creating, configuring, sending and receiving a message on a topic:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Administrative Operations&lt;/strong&gt;&lt;/p&gt;

&lt;pre style="border-bottom: #cecece 1px solid; border-left: #cecece 1px solid; padding-bottom: 5px; background-color: #fbfbfb; min-height: 40px; padding-left: 5px; width: 836px; padding-right: 5px; height: 632px; overflow: auto; border-top: #cecece 1px solid; border-right: #cecece 1px solid; padding-top: 5px"&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;  1:             &lt;span style="color: #008000"&gt;// Configure and create NamespaceManager for performing administrative operations&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;  2:             NamespaceManagerSettings settings = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; NamespaceManagerSettings();
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;  3:             settings.TokenProvider = TokenProvider.CreateSharedSecretTokenProvider(issuer, key);
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;  4:             NamespaceManager manager = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; NamespaceManager(ServiceBusEnvironment.CreateServiceUri("&lt;span style="color: #8b0000"&gt;sb&lt;/span&gt;", serviceNamespace, &lt;span style="color: #0000ff"&gt;string&lt;/span&gt;.Empty), settings);
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;  5: 
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;  6:             &lt;span style="color: #008000"&gt;// Check for existence of topics on the fabric&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;  7:             var topics = manager.GetTopics();
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;  8: 
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;  9:             var result = from t &lt;span style="color: #0000ff"&gt;in&lt;/span&gt; topics
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 10:                          where t.Path.Equals(topicName, StringComparison.OrdinalIgnoreCase)
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 11:                          select t;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 12: 
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 13:             &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (result.Count() == 0)
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 14:             {
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 15:                 Console.WriteLine("&lt;span style="color: #8b0000"&gt;Topic does not exist&lt;/span&gt;");
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 16: 
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 17:                 &lt;span style="color: #008000"&gt;// Create Queue&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 18:                 Console.WriteLine("&lt;span style="color: #8b0000"&gt;Creating Topic...&lt;/span&gt;");
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 19: 
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 20:                 TopicDescription topic = manager.CreateTopic(topicName);
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 21:             }
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 22: 
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 23:             &lt;span style="color: #008000"&gt;// Create Subscriptions for InventoryServiceSubscription and CreditServiceSubscription and associate to OrdersTopic:&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 24:             SubscriptionDescription inventoryServiceSubscription = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; SubscriptionDescription(topicName, "&lt;span style="color: #8b0000"&gt;InventoryServiceSubscription&lt;/span&gt;");
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 25:             SubscriptionDescription creditServiceSubscription = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; SubscriptionDescription(topicName, "&lt;span style="color: #8b0000"&gt;CreditServiceSubscription&lt;/span&gt;");
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 26: 
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 27: 
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 28:             &lt;span style="color: #008000"&gt;// Set up Filters for NorthAmericaFulfillmentServiceSubscription&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 29:             RuleDescription northAmericafulfillmentRuleDescription = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; RuleDescription();
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 30:             northAmericafulfillmentRuleDescription.Filter = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; SqlFilter("&lt;span style="color: #8b0000"&gt;CountryOfOrigin = 'USA' OR CountryOfOrigin ='Canada' OR CountryOfOrgin ='Mexico'&lt;/span&gt;");
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 31:             northAmericafulfillmentRuleDescription.Action = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; SqlRuleAction("&lt;span style="color: #8b0000"&gt;set FulfillmentRegion='North America'&lt;/span&gt;");
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 32: 
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 33: 
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 34:             &lt;span style="color: #008000"&gt;// Create Subscriptions&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 35:             SubscriptionDescription northAmericaFulfillmentServiceSubscription = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; SubscriptionDescription(topicName, "&lt;span style="color: #8b0000"&gt;NorthAmericaFulfillmentServiceSubscription&lt;/span&gt;");
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 36: 
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 37:             &lt;span style="color: #008000"&gt;// Delete existing subscriptions&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 38:             &lt;span style="color: #0000ff"&gt;try&lt;/span&gt; { manager.DeleteSubscription(topicName, inventoryServiceSubscription.Name); } &lt;span style="color: #0000ff"&gt;catch&lt;/span&gt; { };
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 39:             &lt;span style="color: #0000ff"&gt;try&lt;/span&gt; { manager.DeleteSubscription(topicName, creditServiceSubscription.Name); } &lt;span style="color: #0000ff"&gt;catch&lt;/span&gt; { };
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 40:             &lt;span style="color: #0000ff"&gt;try&lt;/span&gt; { manager.DeleteSubscription(topicName, northAmericaFulfillmentServiceSubscription.Name); } &lt;span style="color: #0000ff"&gt;catch&lt;/span&gt; { };
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 41: 
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 42:             
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 43:             &lt;span style="color: #008000"&gt;// Add Subscriptions and Rules to Topic&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 44:             manager.CreateSubscription(inventoryServiceSubscription);
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 45:             manager.CreateSubscription(creditServiceSubscription);
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 46:             manager.CreateSubscription(northAmericaFulfillmentServiceSubscription, northAmericafulfillmentRuleDescription);
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 47:             &lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Runtime Operations&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;pre style="border-bottom: #cecece 1px solid; border-left: #cecece 1px solid; padding-bottom: 5px; background-color: #fbfbfb; min-height: 40px; padding-left: 5px; width: 842px; padding-right: 5px; height: 631px; overflow: auto; border-top: #cecece 1px solid; border-right: #cecece 1px solid; padding-top: 5px"&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;  1:             &lt;span style="color: #008000"&gt;// Create and Configure Messaging Factory to provision TopicClient&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;  2:             MessagingFactorySettings runtimeSettings = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; MessagingFactorySettings();
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;  3:             runtimeSettings.TokenProvider = TokenProvider.CreateSharedSecretTokenProvider(issuer, key);
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;  4:             MessagingFactory messagingFactory = MessagingFactory.Create(ServiceBusEnvironment.CreateServiceUri("&lt;span style="color: #8b0000"&gt;sb&lt;/span&gt;",serviceNamespace,String.Empty),runtimeSettings);
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;  5:             
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;  6:             &lt;span style="color: #008000"&gt;// Create Topic Client for sending messages to the Topic:&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;  7:             TopicClient client = messagingFactory.CreateTopicClient(topicName);
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;  8:          
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;  9:             &lt;span style="color: #008000"&gt;/***********************
&lt;/span&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 10:              *** Send Operations ***
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 11:              ***********************/
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 12: 
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 13:             &lt;span style="color: #008000"&gt;// Prepare BrokeredMessage and corresponding properties&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 14:             Order order = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Order();
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 15:             order.OrderId = 42;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 16:             order.Products.Add("&lt;span style="color: #8b0000"&gt;Kinect&lt;/span&gt;", 70.50M);
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 17:             order.Products.Add("&lt;span style="color: #8b0000"&gt;XBOX 360&lt;/span&gt;", 199.99M);
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 18:             order.Total = order.Products["&lt;span style="color: #8b0000"&gt;Kinect&lt;/span&gt;"] + order.Products["&lt;span style="color: #8b0000"&gt;XBOX 360&lt;/span&gt;"];
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 19: 
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 20:             &lt;span style="color: #008000"&gt;// Set the body to the Order data contract&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 21:             BrokeredMessage msg = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; BrokeredMessage(order);
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 22:             
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 23:             &lt;span style="color: #008000"&gt;// Set properties for use in RuleDescription&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 24:             msg.Properties.Add("&lt;span style="color: #8b0000"&gt;CountryOfOrigin&lt;/span&gt;", "&lt;span style="color: #8b0000"&gt;USA&lt;/span&gt;");
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 25:             msg.Properties.Add("&lt;span style="color: #8b0000"&gt;FulfillmentRegion&lt;/span&gt;", "&lt;span style="color: #8b0000"&gt;&lt;/span&gt;");
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 26:             
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 27:             &lt;span style="color: #008000"&gt;// Send the message to the OrdersTopic&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 28:             client.Send(msg);
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 29:             client.Close();
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 30:             
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 31:            &lt;span style="color: #008000"&gt;/**************************
&lt;/span&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 32:              *** Receive Operations ***
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 33:            ****************************/
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 34:         
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 35:             BrokeredMessage recdMsg;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 36:             Order recdOrder;
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 37: 
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 38:             &lt;span style="color: #008000"&gt;// Inventory Service Subscriber&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 39:             SubscriptionClient inventoryServiceSubscriber = messagingFactory.CreateSubscriptionClient(topicName, "&lt;span style="color: #8b0000"&gt;InventoryServiceSubscription&lt;/span&gt;",ReceiveMode.PeekLock);
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 40:             
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 41:             &lt;span style="color: #008000"&gt;// Read the message from the OrdersTopic&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 42:             &lt;span style="color: #0000ff"&gt;while&lt;/span&gt; ((recdMsg = inventoryServiceSubscriber.Receive(TimeSpan.FromSeconds(5))) != &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;)
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 43:             {   
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 44:                 &lt;span style="color: #008000"&gt;// Convert from BrokeredMessage to native Order&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 45:                 recdOrder = recdMsg.GetBody&amp;lt;Order&amp;gt;();
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 46: 
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 47:                 &lt;span style="color: #008000"&gt;// Complete read, release and delete message from the fabric&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 48:                 inventoryServiceSubscriber.Complete(recdMsg.LockToken);
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 49: 
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 50:                 Console.ForegroundColor = ConsoleColor.Green;
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 51:                 Console.WriteLine("&lt;span style="color: #8b0000"&gt;Received Order {0} \n\t on {1} \n\t with Message Id {2} \n\t and Lock Token {3}.&lt;/span&gt;", recdOrder.OrderId, "&lt;span style="color: #8b0000"&gt;Inventory Service Subscriber&lt;/span&gt;", recdMsg.MessageId, recdMsg.LockToken);
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 52:             }
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 53:             inventoryServiceSubscriber.Close();
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 54: 
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 55:             &lt;span style="color: #008000"&gt;// Credit Service Subscriber&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 56:             SubscriptionClient creditServiceSubscriber = messagingFactory.CreateSubscriptionClient(topicName, "&lt;span style="color: #8b0000"&gt;CreditServiceSubscription&lt;/span&gt;");
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 57: 
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 58:             &lt;span style="color: #008000"&gt;// Read the message from the OrdersTopic&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 59:             recdMsg = creditServiceSubscriber.Receive();
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 60: 
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 61:             &lt;span style="color: #008000"&gt;// Convert from BrokeredMessage to native Order&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 62:             recdOrder = recdMsg.GetBody&amp;lt;Order&amp;gt;();
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 63: 
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 64:             &lt;span style="color: #008000"&gt;// Complete read, release and delete message from the fabric&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 65:             creditServiceSubscriber.Complete(recdMsg.LockToken);
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 66: 
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 67:             Console.ForegroundColor = ConsoleColor.Green;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 68:             Console.WriteLine("&lt;span style="color: #8b0000"&gt;Received Order {0} \n\t on {1} \n\t with Message Id {2} \n\t and Lock Token {3}.&lt;/span&gt;", recdOrder.OrderId, "&lt;span style="color: #8b0000"&gt;Credit Service Subscriber&lt;/span&gt;", recdMsg.MessageId, recdMsg.LockToken);
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 69: 
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 70:             creditServiceSubscriber.Close();
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 71: 
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 72:             &lt;span style="color: #008000"&gt;// Fulfillment Service Subscriber for the North America Fulfillment Service Subscription&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 73:             SubscriptionClient northAmericaFulfillmentServiceSubscriber = messagingFactory.CreateSubscriptionClient(topicName, "&lt;span style="color: #8b0000"&gt;northAmericaFulfillmentServiceSubscription&lt;/span&gt;");
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 74:             
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 75:             &lt;span style="color: #008000"&gt;// Read the message from the OrdersTopic for the North America Fulfillment Service Subscription&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 76:             recdMsg = northAmericaFulfillmentServiceSubscriber.Receive(TimeSpan.FromSeconds(5));
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 77: 
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 78:             
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 79:            &lt;span style="color: #0000ff"&gt;if&lt;/span&gt;(recdMsg != &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;)
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 80:             {
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 81:                 &lt;span style="color: #008000"&gt;// Convert from BrokeredMessage to native Order&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 82:                 recdOrder = recdMsg.GetBody&amp;lt;Order&amp;gt;();
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 83: 
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 84:                 &lt;span style="color: #008000"&gt;// Complete read, release and delete message from the fabric&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 85:                 northAmericaFulfillmentServiceSubscriber.Complete(recdMsg.LockToken);
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 86: 
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 87:                 Console.ForegroundColor = ConsoleColor.Green;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 88:                 Console.WriteLine("&lt;span style="color: #8b0000"&gt;Received Order {0} \n\t on {1} \n\t with Message Id {2} \n\t and Lock Token {3}.&lt;/span&gt;", recdOrder.OrderId, "&lt;span style="color: #8b0000"&gt;North America Fulfillment Service Subscriber&lt;/span&gt;", recdMsg.MessageId, recdMsg.LockToken);
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 89:             }
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 90:             &lt;span style="color: #0000ff"&gt;else&lt;/span&gt;
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 91:             {
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 92:                 Console.ForegroundColor = ConsoleColor.Yellow;
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 93:                 Console.WriteLine("&lt;span style="color: #8b0000"&gt;No messages for North America found.&lt;/span&gt;");
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 94:             }
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 95:             
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt; 96:             northAmericaFulfillmentServiceSubscriber.Close();&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;&lt;font size="3"&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When running this sample, you’ll see that I have received Order 42 on my Inventory, Credit and North America Fulfillment Service subscriptions:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://rickgaribay.net/images/rickgaribay_net/Windows-Live-Writer/AppFabric-Service-Bus-Queues--Topics-Rel_D1C0/image_6.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; margin: 2px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://rickgaribay.net/images/rickgaribay_net/Windows-Live-Writer/AppFabric-Service-Bus-Queues--Topics-Rel_D1C0/image_thumb_2.png" width="802" height="244" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;font size="3"&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;font size="3"&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;font size="3"&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;font size="3"&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;font size="3"&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;font size="3"&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;font size="3"&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;font size="3"&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;font size="4"&gt;WCF&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;One of the great things about the WCF programming model is that it abstracts much of the underlying communication details and as such, other than dropping in a new assembly and and refactoring the binding and configuration, it is not greatly affected by the API changes from the May/June CTP to GA.&lt;/p&gt;

&lt;p&gt;As I mentioned, one thing that has changed is that the ServiceBusMessagingBinding has been renamed to NetMessagingBinding. I’ll be covering and end to end example of using the NetMessagingBinding in my upcoming article in &lt;a href="http://www.code-magazine.com/SearchResults.aspx?search=garibay" target="_blank"&gt;CODE Magazine&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;font size="4"&gt;REST API&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The REST API is key to delivering these new capabilities across a variety of client platforms and remains largely unchanged, however one key change is how message properties are handled. Instead of individual headers for each, there is now one header with  all the properties JSON encoded. Please refer to the updated REST API Reference doc for details. I’ll also be covering and end-to-end example of using the REST API to write an read to/from a queue in my upcoming article in &lt;a href="http://www.code-magazine.com/SearchResults.aspx?search=garibay" target="_blank"&gt;CODE Magazine&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;font size="4"&gt;More Coming Soon&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;As I mentioned, in my upcoming article in &lt;a href="http://www.code-magazine.com/SearchResults.aspx?search=garibay" target="_blank"&gt;CODE Magazine&lt;/a&gt;, I’ll cover the Why, What, and How behind Azure AppFabric Service Bus Brokered Messaging including end to end walkthroughs with the .NET Client API, REST API and WCF Binding. The November/December issue should be on newsstands (including Barnes and Noble) or your mailbox towards the end of October. You can also find the article online at &lt;a href="http://code-magazine.com"&gt;http://code-magazine.com&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;font size="4"&gt;Resources&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You can learn more about this exciting release as well as download the GA SDK version 1.5 by visiting the following resources:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Azure AppFabric SDK 1.5:&lt;a title="http://www.microsoft.com/download/en/details.aspx?id=27421" href="http://www.microsoft.com/download/en/details.aspx?id=27421"&gt;http://www.microsoft.com/download/en/details.aspx?id=27421&lt;/a&gt; &lt;/li&gt;

  &lt;li&gt;&lt;a href="http://twitter.com/clemensv" target="_blank"&gt;Clemens Vasters&lt;/a&gt; on the May CTP: &lt;a title="http://vasters.com/clemensv/2011/05/16/Introducing+The+Windows+Azure+AppFabric+Service+Bus+May+2011+CTP.aspx" href="http://vasters.com/clemensv/2011/05/16/Introducing+The+Windows+Azure+AppFabric+Service+Bus+May+2011+CTP.aspx"&gt;http://vasters.com/clemensv/2011/05/16/Introducing+The+Windows+Azure+AppFabric+Service+Bus+May+2011+CTP.aspx&lt;/a&gt;  &lt;/li&gt;

  &lt;li&gt;Great video by &lt;a href="http://twitter.com/clemensv" target="_blank"&gt;Clemens Vasters&lt;/a&gt; on Brokered Messaging: &lt;a title="http://vasters.com/clemensv/2011/06/11/Understanding+Windows+Azure+AppFabric+Queues+And+Topics.aspx" href="http://vasters.com/clemensv/2011/06/11/Understanding+Windows+Azure+AppFabric+Queues+And+Topics.aspx"&gt;http://vasters.com/clemensv/2011/06/11/Understanding+Windows+Azure+AppFabric+Queues+And+Topics.aspx&lt;/a&gt;  &lt;/li&gt;

  &lt;li&gt;&lt;a href="http://twitter.com/#!/dingha" target="_blank"&gt;David Ingham&lt;/a&gt; on Queues: &lt;a title="http://blogs.msdn.com//b/appfabric/archive/2011/05/17/an-introduction-to-service-bus-queues.aspx" href="http://blogs.msdn.com//b/appfabric/archive/2011/05/17/an-introduction-to-service-bus-queues.aspx"&gt;http://blogs.msdn.com//b/appfabric/archive/2011/05/17/an-introduction-to-service-bus-queues.aspx&lt;/a&gt; &lt;/li&gt;

  &lt;li&gt;&lt;a href="http://twitter.com/#!/dingha" target="_blank"&gt;David Ingham&lt;/a&gt; on Topics: &lt;a title="http://blogs.msdn.com//b/appfabric/archive/2011/05/25/an-introduction-to-service-bus-topics.aspx" href="http://blogs.msdn.com//b/appfabric/archive/2011/05/25/an-introduction-to-service-bus-topics.aspx"&gt;http://blogs.msdn.com//b/appfabric/archive/2011/05/25/an-introduction-to-service-bus-topics.aspx&lt;/a&gt;  &lt;/li&gt;

  &lt;li&gt;&lt;a href="http://twitter.com/rickggaribay" target="_blank"&gt;My&lt;/a&gt; Introduction to Queues: &lt;a title="http://rickgaribay.net/archive/2011/05/17/appfabric-service-bus-v2-ctp.aspx" href="http://rickgaribay.net/archive/2011/05/17/appfabric-service-bus-v2-ctp.aspx"&gt;http://rickgaribay.net/archive/2011/05/17/appfabric-service-bus-v2-ctp.aspx&lt;/a&gt;  &lt;/li&gt;

  &lt;li&gt;&lt;a href="http://twitter.com/rickggaribay" target="_blank"&gt;My&lt;/a&gt; Introduction to Topics:&lt;a title="http://rickgaribay.net/archive/2011/05/31/exploring-appfabric-service-bus-v2-may-ctp-topics.aspx" href="http://rickgaribay.net/archive/2011/05/31/exploring-appfabric-service-bus-v2-may-ctp-topics.aspx"&gt;http://rickgaribay.net/archive/2011/05/31/exploring-appfabric-service-bus-v2-may-ctp-topics.aspx&lt;/a&gt; &lt;/li&gt;
&lt;/ul&gt;&lt;img src="http://rickgaribay.net/aggbug/315.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Rick G. Garibay</dc:creator>
            <guid>http://rickgaribay.net/archive/2011/09/14/azure-appfabric-service-bus-brokered-messaging-ga-amp-rude-ctp.aspx</guid>
            <pubDate>Wed, 14 Sep 2011 16:46:52 GMT</pubDate>
            <comments>http://rickgaribay.net/archive/2011/09/14/azure-appfabric-service-bus-brokered-messaging-ga-amp-rude-ctp.aspx#feedback</comments>
            <slash:comments>2</slash:comments>
            <wfw:commentRss>http://rickgaribay.net/comments/commentRss/315.aspx</wfw:commentRss>
            <trackback:ping>http://rickgaribay.net/services/trackbacks/315.aspx</trackback:ping>
        </item>
    </channel>
</rss>
