Neuron ESB http://rickgaribay.net/category/37.aspx Neuron ESB en-US Rick G. Garibay rickgaribay@hotmail.com Subtext Version 1.9.5.176 IoT, Mobility, Hybrid Cloud, ESB Oh My! A Closer Look at the Neudesic Gartner AADI Demo http://rickgaribay.net/archive/2013/12/21/iot-mobility-hybrid-cloud-esb-oh-my-a-closer-look.aspx <p>Earlier this week, my colleague <a href="http://twitter.com/simonguest" target="_blank">@simonguest</a> <a href="http://simonguest.com/2013/12/12/ibeacon-demo-at-gartner-aadi/" target="_blank">posted a great summary</a> of the demo he and I built together for the <a href="http://www.gartner.com/technology/summits/na/applications/" target="_blank">Gartner AADI Summit</a> in Las Vegas week before last.<a href="http://rickgaribay.net/Images/CustomContent/ModernMobilityatGartnerAADI_D46E/image_8.png"><img style="border-bottom: 0px; border-left: 0px; margin: 5px 5px 5px 30px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" align="right" src="http://rickgaribay.net/Images/CustomContent/ModernMobilityatGartnerAADI_D46E/image_thumb_8.png" width="389" height="480" /></a> </p> <p>As Simon illustrates, the demo combined two areas we are thinking a lot about these days at Neudesic- enterprise mobility and Internet of Things. </p> <p>When we talk about enterprise mobility, we're not talking about mobile device management, governance or provisioning. Our focus is on unlocking the assets that live on premises, behind the firewall so that they are safely and securely exposed, composed and consumed by a variety of devices and composite business applications on the web.</p> <p>In this post, I’ll talk a little bit more about these two areas and dive into the back-end of the demo from a messaging and services perspective to give you a glimpse into the internals of the demo app.   </p> <p><strong><u>Exposing On-Premise Assets</u></strong></p> <p>The key unlocking event for enterprise mobility is enabling the ability to expose assets that live within an organization’s traditional datacenter. These assets include things like other apps, LOB systems, ERPs and databases. In the most traditional sense, the way this problem has been solved is by determining what assets need to be made available, standing up hardware on a DMZ and specifying which inbound ports allow which kind of traffic. Unfortunately, there’s really nothing too innovative about this approach as it is the way we’ve been solving this problem for nearly 20 years. </p> <p>Today, there are many enterprise mobility vendors out there offering an appliance based offering which extends this approach to address things like security, hardware compression, etc., but the agility of these solutions is questionable as they still required CapEx spend, time and resources to provision and manage. </p> <p>Another kind of on-premise asset you will be hearing more and more about involves sensors and devices that communicate with software and other devices. This Machine to Machine (M2M) communication will be revolutionary in domain<a href="http://rickgaribay.net/Images/CustomContent/ModernMobilityatGartnerAADI_D46E/image.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; margin-left: 0px; border-left-width: 0px; margin-right: 0px" title="image" border="0" alt="image" align="left" src="http://rickgaribay.net/Images/CustomContent/ModernMobilityatGartnerAADI_D46E/image_thumb.png" width="191" height="93" /></a>s such as transportation, retail, logistics, oil and gas, manufacturing, etc. as they will enable the ability to yield new insights that will at first transform business and then become key to survival. One such device is known as iBeacon.</p> <p>These devices, about the width and half the length of a stick of gum run on Bluetooth Low Energy (BLE) and thus require very little power. These beacons transmit a unique identifier along with signal strength which can then be used to calculate proximity. </p> <p>You can easily imagine a scenario where a retailer provides a free app that interacts with you in the store as you approach these iBeacons. As you might imagine, the back end of the app would learn your behaviors and preferences and target you with interesting offers to influence your browsing and buying habits as well as crowd sourcing what ideal retail layouts look like based on the tons of data that could be collected and modeled. Another scenario might involve tracking shipping containers on trucks. Today, 5.9 RFID technology dominates this space but the amount of infrastructure required to read the tags compared to what can be accomplished with a handful of iBeacons and a handheld device is disruptive indeed. To illustrate this in our demo, our iBeacons communicated directly with iOS and Android handsets, with literally no set up or tear down, allowing us to enumerate, update and “check into” the beacons that were placed throughout the conference floor. </p> <p>For the check in scenario, as you approached an iBeacon, the app would raise an event allowing you to check in to that location. The app then sent a message over the Gartner guest conference WIFI network to a server hosted in our datacenter in Irvine, CA running <a href="http://products.neudesic.com/features" target="_blank">Neuron ESB</a>. The server sits behind our firewall and no inbound ports are open because our IT policy rightfully prohibits it. Instead, a single outbound port is opened by Neuron over an Azure Service Bus Relay which allows for secure, bi-directional messaging for a number of APIs that we implemented which I’ll cover in more detail next.</p> <p><strong><u>Composing and Consuming</u></strong></p> <p>As you can see in the demo sample architecture, we exposed a REST head over Azure Service Bus which provided the external messaging fabric for communicating with the apps running on iOS and Android in the Gartner exhibition hall. Using Neuron’s messaging and processing capabilities, we implemented the following 4 APIs:</p> <p> </p> <table border="0" cellspacing="0" cellpadding="2" width="882"><tbody> <tr> <td valign="top" width="424"> <p><strong></strong></p> <ul> <li><strong>REGISTER BEACON</strong> <br />PUT /beacons <br />{ id: "&lt;&lt;GUID&gt;&gt;", name: "Neudesic Booth, Expo Hall"} </li> </ul> <p> </p> <p> <br /></p> <ul> <li><strong>LOOK UP BEACON</strong> <br />GET /beacons <br />[{ id: "&lt;&lt;GUID&gt;&gt;", name: "Beacon name"}, {id: "&lt;&lt;GUID&gt;&gt;", name: "Beacon name"}] (Array) </li> </ul> <p> </p> <p> <br /></p> <ul> <li><strong>GET ALL BEACONS</strong> <br />GET /beacons/:id <br />{ id: "&lt;&lt;GUID&gt;&gt;", name: "Beacon name"} </li> </ul> <p> </p> <p> <br /></p> <ul> <li><strong>CHECK IN TO BEACON</strong> <br />PUT /beacons/:id/checkin <br />{ userid: "&lt;&lt;facebookid&gt;&gt;" } </li> </ul> <p></p> </td> <td valign="top" width="456"><a href="http://rickgaribay.net/Images/CustomContent/ModernMobilityatGartnerAADI_D46E/image_3.png"><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="image" border="0" alt="image" src="http://rickgaribay.net/Images/CustomContent/ModernMobilityatGartnerAADI_D46E/image_thumb_3.png" width="251" height="480" /></a> <br /><font size="1">The Android version of the app the weekend before the conference. We used Xamarin to build a consistent UX for iOS as well. The iBeacons were re-registered with the actual locations of the booths on the conference floor within a few seconds. </font></td> </tr> </tbody></table> <p> </p> <p>To create a connection to Azure Service Bus, we simply created a Client Connector within a Service Endpoint in Neuron as shown below:</p> <p><a href="http://rickgaribay.net/Images/CustomContent/ModernMobilityatGartnerAADI_D46E/image_4.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://rickgaribay.net/Images/CustomContent/ModernMobilityatGartnerAADI_D46E/image_thumb_4.png" width="617" height="414" /></a> </p> <p>Neuron hosts an instance of the WCF NetMessagingBinding and creates a virtual service endpoint using the URI shown above. </p> <p>In order to route the requests from the app to the right logic, we implemented a simple controller called “Beacon Router” using a Neuron Process. Using a Decision step, we added 4 branches for each API:</p> <p><a href="http://rickgaribay.net/Images/CustomContent/ModernMobilityatGartnerAADI_D46E/image_5.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://rickgaribay.net/Images/CustomContent/ModernMobilityatGartnerAADI_D46E/image_thumb_5.png" width="441" height="480" /></a> </p> <p>Each Decision Step has a condition which returns true or false. If the condition returns true, the steps within the branch are executed. If not, the Process evaluates each branch until a match is found our returns a 404, Resource not Found. </p> <p>Here is a look at the the Check In Condition:</p> <p><a href="http://rickgaribay.net/Images/CustomContent/ModernMobilityatGartnerAADI_D46E/image_6.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://rickgaribay.net/Images/CustomContent/ModernMobilityatGartnerAADI_D46E/image_thumb_6.png" width="640" height="422" /></a> </p> <p>As you can see, we used a simple UriTemplate to define the template for the Check In API. The URI is stored in the ESB message context within the MessageHeader.To property. If the template matches the actual URI, we return true and the steps within the branch execute in sequence. </p> <p>The next step that fires is the Publish step. We included this step for testing purposes to serve as Wire Tap on the messages that reach the branch. In this case, this was useful for inspecting the message off the wire by configuring a subscribing party and using our Neuron Test Client to inspect the message:</p> <p><a href="http://rickgaribay.net/Images/CustomContent/ModernMobilityatGartnerAADI_D46E/image_7.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://rickgaribay.net/Images/CustomContent/ModernMobilityatGartnerAADI_D46E/image_thumb_7.png" width="568" height="480" /></a> </p> <p>This little trick aside, the Publish step is very powerful in that it allows you to asynchronously publish a message on a topic for other subscribers to pick up. Think of Scatter Gather as a good example. </p> <p>The next step you’ll notice is a Call Process step. This step simply allows you to call a nested Process which is helpful in factoring your Process (note that we could have chosen to asynchronously execute a nested process by wrapping it inside a Parallel step).</p> <p>The Check In process starts with a Push step. This step stores the current message for later use. </p> <p>This was required because we needed to first determine if the iBeacon location was valid before allowing a check in. The way Neuron Processes work is that the message is modified by each step allowing for very powerful enrichment and transformation of the message. However, since there can only be one message in context at any time, the current message is overwritten by the message we crafted up for the ODBC step which follows. </p> <p>In this case, we used the ODBC step to query SQL Server for the iBeacon guid. The ODBC step expects a message that conforms to it’s interface, a simple XML syntax for defining the query:</p> <div class="csharpcode"> <pre style="width: 73%; height: 20px" class="alt"><span class="lnum"> 1: </span><span class="kwrd">string</span> sql = String.Empty; </pre> <pre><span class="lnum"> 2: </span> <a href="http://rickgaribay.net/Images/CustomContent/ModernMobilityatGartnerAADI_D46E/SNAGHTMLd1870c0.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; margin-left: 0px; border-left-width: 0px; margin-right: 0px" title="SNAGHTMLd1870c0" border="0" alt="SNAGHTMLd1870c0" align="right" src="http://rickgaribay.net/Images/CustomContent/ModernMobilityatGartnerAADI_D46E/SNAGHTMLd1870c0_thumb.png" width="352" height="1234" /></a></pre> <pre style="width: 73%; height: 20px" class="alt"><span class="lnum"> 3: </span>sql += <span class="str">"&lt;Statement type=\"Text\" sql=\"SELECT * FROM [dbo].[Beacon] WHERE BeaconGuid =?\"&gt;"</span>; </pre> <pre><span class="lnum"> 4: </span>sql += <span class="str">"&lt;Parameters&gt;"</span>; </pre> <pre style="width: 73%; height: 20px" class="alt"><span class="lnum"> 5: </span>sql += <span class="str">"&lt;Parameter type=\"varchar\" name=\"@BeaconGuid\" value=\""</span> + beaconId + <span class="str">"\"/&gt;"</span>; </pre> <pre><span class="lnum"> 6: </span>sql += <span class="str">"&lt;/Parameters&gt;"</span>; </pre> <pre style="width: 73%; height: 20px" class="alt"><span class="lnum"> 7: </span>sql += <span class="str">"&lt;/Statement&gt;"</span>; </pre> <pre><span class="lnum"> 8: </span> </pre> <pre style="width: 73%; height: 20px" class="alt"><span class="lnum"> 9: </span>context.Data.FromXml(sql);</pre> </div> <style type="text/css"><![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; }]]></style> <p> </p> <p>Note line 9 above replaces the message in the context with this new message. The ODBC step executes the query based on the latest context and returns the result:</p> <pre class="csharpcode"><span class="kwrd">&lt;</span><span class="html">QueryResults</span><span class="kwrd">&gt;</span> <span class="kwrd">&lt;</span><span class="html">QueryResult</span><span class="kwrd">&gt;</span> <span class="kwrd">&lt;</span><span class="html">Id</span><span class="kwrd">&gt;</span>2<span class="kwrd">&lt;/</span><span class="html">Id</span><span class="kwrd">&gt;</span> <span class="kwrd">&lt;</span><span class="html">BeaconGuid</span><span class="kwrd">&gt;</span>1.1<span class="kwrd">&lt;/</span><span class="html">BeaconGuid</span><span class="kwrd">&gt;</span> <span class="kwrd">&lt;</span><span class="html">BeaconName</span><span class="kwrd">&gt;</span>Neudesic Booth<span class="kwrd">&lt;/</span><span class="html">BeaconName</span><span class="kwrd">&gt;</span> <span class="kwrd">&lt;</span><span class="html">QueryResults</span><span class="kwrd">&gt;</span> <span class="kwrd">&lt;</span><span class="html">QueryResult</span><span class="kwrd">&gt;</span></pre> <style type="text/css"><![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; }]]></style> <p></p> <p>Next, we used a Decision step to check to see if the ODBC step yielded the iBeacon we looked up:</p> <div class="csharpcode"> <pre style="width: 73%; height: 20px" class="alt"><span class="lnum"> 1: </span>var xml = context.Data.ToXmlDocument(); </pre> <pre><span class="lnum"> 2: </span>var node = xml.GetElementsByTagName(<span class="str">"QueryResult"</span>); </pre> <pre style="width: 73%; height: 20px" class="alt"><span class="lnum"> 3: </span><span class="kwrd">return</span> node.Count &gt; 0;</pre> </div> <style type="text/css"><![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; }]]></style> <p>If the node count is not zero, we know we have a match. Otherwise, we issue a 404 since the resource could not be found. </p> <p>Recall that at the beginning of the process execution, the first thing we did was push the message into temporary storage so that we could retrieve it later. Once we determined that the iBeacon exists, we pop the message back into context so that we can grab the iBeacon id from the URI and the user id of the user (in this case, a facebook email address) from the original HTTP message body.</p> <p>To perform the chec kin, we simply did an INSERT into a SQL Server table called CheckIn. The Code step includes the following code, which as before, the ODBC step will consume and perform the unit of work. </p> <p>Since the iBeacon ID is part of the URI, we use UriTemplate again to determine a match and then extract the {id} parameter from the URI:</p> <div class="csharpcode"> <pre style="width: 73%; height: 20px" class="alt"><span class="lnum"> 1: </span>System.UriTemplate template = <span class="kwrd">new</span> System.UriTemplate(<span class="str">"/beacons/{id}/checkin"</span>);</pre> <pre><span class="lnum"> 2: </span>Uri uri = <span class="kwrd">new</span> Uri(context.Data.GetProperty(<span class="str">"MessageHeader"</span>,<span class="str">"To"</span>));</pre> <pre style="width: 73%; height: 20px" class="alt"><span class="lnum"> 3: </span>Uri baseUri = <span class="kwrd">new</span> Uri(<span class="str">"https://"</span> + uri.Host);</pre> <pre><span class="lnum"> 4: </span>var match = template.Match(baseUri, uri);</pre> <pre style="width: 73%; height: 20px" class="alt"><span class="lnum"> 5: </span> </pre> <pre><span class="lnum"> 6: </span>var beaconId = match.RelativePathSegments[1];</pre> </div> <style type="text/css"><![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; }]]></style> <p>From there, we do some formatting and grab the user id from the JSON message payload that was provided in the HTTP body: </p> <div class="csharpcode"> <pre style="width: 73%; height: 20px" class="alt"><span class="lnum"> 1: </span>System.Web.Script.Serialization.JavaScriptSerializer serializer = <span class="kwrd">new</span> System.Web.Script.Serialization.JavaScriptSerializer();</pre> <pre><span class="lnum"> 2: </span> </pre> <pre style="width: 73%; height: 20px" class="alt"><span class="lnum"> 3: </span>Neudesic.TPG.GartnerAADI.Model.CheckIn checkIn = <span class="kwrd">new</span> </pre> <pre><span class="lnum"> 4: </span>System.Web.Script.Serialization.JavaScriptSerializer().Deserialize&lt;Neudesic.TPG.GartnerAADI.Model.CheckIn&gt;(jsonString);</pre> </div> <style type="text/css"><![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; }]]></style> <p>Finally, we build the INSERT statement and load the new message context: </p> <div class="csharpcode"> <pre style="width: 73%; height: 20px" class="alt"><span class="lnum"> 1: </span><span class="kwrd">string</span> sql = String.Empty;</pre> <pre><span class="lnum"> 2: </span> </pre> <pre style="width: 73%; height: 20px" class="alt"><span class="lnum"> 3: </span>sql += <span class="str">"&lt;Statement type=\"Text\" sql=\"INSERT INTO [dbo].[CheckIn]([UserId],[BeaconGuid],[Date]) VALUES(?,?,?)\"&gt;"</span>;</pre> <pre><span class="lnum"> 4: </span>sql += <span class="str">"&lt;Parameters&gt;"</span>;</pre> <pre style="width: 73%; height: 20px" class="alt"><span class="lnum"> 5: </span>sql += <span class="str">"&lt;Parameter type=\"varchar\" name=\"@UserId\" value=\""</span> + checkIn.UserId + <span class="str">"\"/&gt;"</span>;</pre> <pre><span class="lnum"> 6: </span>sql += <span class="str">"&lt;Parameter type=\"varchar\" name=\"@BeaconGuid\" value=\""</span> + beaconId + <span class="str">"\"/&gt;"</span>;</pre> <pre style="width: 73%; height: 20px" class="alt"><span class="lnum"> 7: </span>sql += <span class="str">"&lt;Parameter type=\"varchar\" name=\"@Date\" value=\""</span> + DateTime.Now.ToString() + <span class="str">"\"/&gt;"</span>;</pre> <pre><span class="lnum"> 8: </span>sql += <span class="str">"&lt;/Parameters&gt;"</span>;</pre> <pre style="width: 73%; height: 20px" class="alt"><span class="lnum"> 9: </span>sql += <span class="str">"&lt;/Statement&gt;"</span>;</pre> <pre><span class="lnum"> 10: </span> </pre> <pre style="width: 73%; height: 20px" class="alt"><span class="lnum"> 11: </span>context.Data.FromXml(sql);</pre> </div> <style type="text/css"><![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; }]]></style> <p>If all goes well, we issue an HTTP 200 back to the client: </p> <div class="csharpcode"> <pre style="width: 73%; height: 20px" class="alt"><span class="lnum"> 1: </span>context.Data.Http = <span class="kwrd">new</span> HttpMessage();</pre> <pre><span class="lnum"> 2: </span>context.Data.Http.StatusCode = System.Net.HttpStatusCode.OK;</pre> <pre style="width: 73%; height: 20px" class="alt"><span class="lnum"> 3: </span>context.Data.FromString(<span class="str">""</span>);</pre> </div> <style type="text/css"><![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; }]]></style> <p>Otherwise we own up to the problem being on our end and return a 500 (with some internal logging of course). </p> <p>The Register API is implemented in much the same way. We check to see if the iBeacon exists and if so, do an update, otherwise insert a new record. Thus, this API supports initial standing up of the beacons as well as managing the names as the beacons moved from development to the expo floor. </p> <p>For the GET APIs, we again used ODBC steps to query for a single or all beacons and returned a single or an array of beacons respectively as you can see in the BeaconRouter screenshot at the beginning of this walkthrough. </p> <p><u><strong>Summary</strong></u></p> <p>As you can probably guess, Simon and I had a lot of fun building this demo and the folks at the conference seemed to find it interesting too :-) </p> <p>There are unlimited possibilities once you unlock the ability to safely and securely transcend network, security and business boundaries behind the firewall. And if agility isn’t enough to compel you to think differently about how you expose and compose your enterprise assets for external consumption by mobile devices today, the proliferation of devices- and I’m not talking about tablets or phones- expected to reach in the excess of 250 billion by 2025, will challenge every industry to think differently about their enterprise messaging and mobility strategy. </p><img src="http://rickgaribay.net/aggbug/362.aspx" width="1" height="1" /> Rick G. Garibay http://rickgaribay.net/archive/2013/12/21/iot-mobility-hybrid-cloud-esb-oh-my-a-closer-look.aspx Sat, 21 Dec 2013 15:49:41 GMT http://rickgaribay.net/archive/2013/12/21/iot-mobility-hybrid-cloud-esb-oh-my-a-closer-look.aspx#feedback http://rickgaribay.net/comments/commentRss/362.aspx http://rickgaribay.net/services/trackbacks/362.aspx Introducing the Neuron Azure Service Bus Adapter for Neuron 3.0 http://rickgaribay.net/archive/2013/02/26/introducing-the-neuron-azure-service-bus-adapter-for-neuron-3.0.aspx <p>Anyone who knows me knows that I’m a messaging nerd. I love messaging so much, that I all but gave up web development years ago to focus exclusively in the completely unglamorous spa<a href="http://rickgaribay.net/images/rickgaribay_net/Windows-Live-Writer/848795df03a9_13251/Neuron_Logo_3_Gray_and_Blue_PNG_6.png"><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="Neuron_Logo_3_Gray_and_Blue_PNG" border="0" alt="Neuron_Logo_3_Gray_and_Blue_PNG" align="right" src="http://rickgaribay.net/images/rickgaribay_net/Windows-Live-Writer/848795df03a9_13251/Neuron_Logo_3_Gray_and_Blue_PNG_thumb_2.png" width="240" height="60" /></a>ce of messaging, integration and middleware. What drives me to this space? Why not spend my time and focus my career on building sexy Web or device apps that are much more fashionable and that will allow people to actually see something tangible, that they can see, touch and feel?</p> <p>These are questions I ponder often, but every time I do, an opportunity presents itself to apply my passion for messaging and integration in new and interesting ways that have a pretty major impact for my clients and the industry as a whole. Some recent examples of projects I led and coded on include the Intelligent Transportation and Gaming space including developing <a href="http://www.prepass.com/services/PrePassGates/Pages/WhatIsPrePassGates.aspx" target="_blank">an automated gate management solution</a> to better secure commercial vehicles for major carriers when they’re off the road; integrating slot machines for a major casino on the Vegas strip with other amenities on property to create an ambient customer experience and <a href="http://www.microsoft.com/casestudies/Case_Study_Detail.aspx?CaseStudyID=710000000945" target="_blank">increasing the safety of our highways by reading license plates and pushing messages to and from the cloud</a>. These are just a few recent examples of the ways in which messaging plays an integral role in building highly compelling and interesting solutions that otherwise wouldn’t be possible. Every day, my amazing team at Neudesic is involved in designing and developing solutions on the Microsoft integration platform that have truly game changing business impacts for our clients.</p> <p>As hybrid cloud continues to prove itself as the most pragmatic approach for taking advantage of the scale and performance of cloud computing, the need for messaging and integration becomes only more important. Two technologies that fit particularly well in this space are Neuron and Azure Service Bus. I won’t take too much time providing an overview of each here as there are plenty of good write ups out there that do a fine job, but I do want to share some exciting news that I hope you will find interesting if you are building hybrid solutions today and/or working with Azure Service Bus or Neuron.</p> <p>Over the last year, the Neuron team at Neudesic has been hard at work cranking out what I think is the most significant release since version 1.0 which I started working with back in 2007 and <a href="http://products.neudesic.com/latest" target="_blank">I’m thrilled to share that as of today, Neuron 3.0 is live!</a></p> <p>Building on top of an already super solid WCF 4.0 foundation, <a href="http://products.neudesic.com/Help3/Neuron.htm" target="_blank">Neuron 3.0</a> is a huge release for both Neudesic and our clients, introducing a ton of new features including:</p> <table border="0" cellspacing="0" cellpadding="2" width="1550"><tbody> <tr> <td valign="top" width="469"> <p> </p> <ul> <li><font size="3">Full Platform support for Microsoft .NET 4/LINQ, Visual Studio 2010/2012 </font></li> <li><font size="3">New features in <strong>Management and Administration</strong> including </font> <ul> <li><font size="3">New User Interface Experience </font></li> <li><font size="3">Queue Management </font></li> <li><font size="3">Server and Instance Management </font></li> <li><font size="3">Dependency Viewers </font></li> </ul> </li> <li><font size="3">New features in <strong>Deployment and Configuration</strong> <strong>Management</strong> including </font> <ul> <li><font size="3">New Neuron ESB Configuration storage </font></li> <li><font size="3">Multi Developer support </font></li> <li><font size="3">Incremental Deployment </font></li> <li><font size="3">Command line Deployment </font></li> </ul> </li> <li><font size="3">New features in <strong>Business Process Designer</strong> including </font></li> <ul> <li><font size="3">Referencing External Assemblies </font></li> <li><font size="3">Zoom, Cut, Copy and Paste </font></li> <li><font size="3">New Process Steps </font></li> <ul> <li><font size="3">Duplicate Message Detection </font></li> <li><font size="3">For Each loop </font></li> <li><font size="3">ODBC</font></li> </ul> </ul> <li><font size="3">New <strong>Custom Process Steps</strong> including </font></li> <ul> <li><font size="3">Interface for Controlling UI Properties </font></li> <li><font size="3">Folder hierarchy for UI display </font></li> </ul> <!--EndFragment--></ul> </td> <td valign="top" width="383"> <p><font size="3"></font></p> <ul> <li><font size="3">New features in <strong>Neuron Auditing</strong> including </font> <ul> <li><font size="3">Microsoft SQL Azure </font></li> <li><font size="3">Excluding Body and Custom Properties </font></li> <li><font size="3">Failed Message Monitoring </font></li> </ul> </li> <li><font size="3">New <strong>Messaging features</strong> including </font> <ul> <li><font size="3">AMQP Powered Topics with Rabbit MQ </font></li> <li><font size="3">Improved MSMQ Topic Support </font></li> <li><font size="3">Adapters </font> <ul> <li><font size="3">POP3 and Microsoft Exchange Adapters </font></li> <li><font size="3">ODBC Adapter enhancements </font></li> <li><font size="3"><strong>Azure Service Bus Adapter</strong> </font></li> </ul> </li> </ul> </li> <li><font size="3">New in <strong>Service Broker</strong> including </font></li> <ul> <li><font size="3">REST enhancements </font></li> <li><font size="3">REST support for Service Policies </font></li> <li><font size="3">WSDL support for hosted SOAP services </font></li> </ul> <li><font size="3">Many enhancements to UI, bug fixes and improvements to overall user experience.</font></li> </ul> </td> <td width="696" align="center"><a href="http://rickgaribay.net/images/rickgaribay_net/Windows-Live-Writer/848795df03a9_13251/image_20.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://rickgaribay.net/images/rickgaribay_net/Windows-Live-Writer/848795df03a9_13251/image_thumb_6.png" width="547" height="464" /></a></td> </tr> </tbody></table> <p>In version 2.6, I worked with the team to bring Azure Service Bus Relay Messaging in as a first-class capability. Since Neuron is built on .NET and WCF, and the relay service is exposed very nicely using the WCF programming model, adding the relay bindings to Neuron’s Service Endpoint feature was a no-brainer. This immediately provided the ability to bridge or extend the on-premise pub-sub messaging, transformation, mediation, enrichment and security capabilities with Azure Service Bus Relay, enabling new, highly innovative hybrid solutions <a href="http://rickgaribay.net/images/rickgaribay_net/Windows-Live-Writer/848795df03a9_13251/image_5.png"><img style="background-image: none; border-right-width: 0px; margin: 10px 5px; 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/rickgaribay_net/Windows-Live-Writer/848795df03a9_13251/image_thumb_1.png" width="538" height="354" /></a>for my team and our customers.</p> <p>Between then and this new release, Microsoft released support for queues and topics also known as <a href="http://msdn.microsoft.com/en-us/library/ee732537.aspx" target="_blank">Brokered Messaging</a>. These capabilities introduced the ability to model durable, pull-based pub-sub messaging in scenarios where such a brokered mechanism makes sense. To be clear, Brokered Messaging is not a replacement for Relay- in fact we’ve worked on a number of solutions where both the firewall friendly push messaging capabilities of relay fit  and even compliment certain scenarios (notification first pull-based pub-sub is a very handy dandy messaging pattern where both are used and perhaps I’ll write that up some day). Think of each being tools in your hybrid cloud messaging tool box. </p> <p>It didn’t take long to see the potential of these additions to Azure Service Bus and I started having discussions with the Neuron team at Neudesic and the Azure Service Bus team at Microsoft about building an adapter that like Relay, would bring Brokered Messaging capabilities to Neuron, enabling a complete, rich spectrum of hybrid messaging capabilities.</p> <p>Luckily, both teams agreed it was a good idea and Neudesic was nice enough to let me write the adapter. </p> <p>Obviously, as a messaging nerd, this was an incredibly fun project to work on and after just a couple of hours, I had my first spike up and running on a very early build of Neuron 3.0 which demonstrated pushing a message that was published to Neuron and re-published on an Azure Service Bus topic. 7 major milestones later, a number of internal demos, walkthroughs with the Service Bus Team and a ton of load and performance testing I completed what is now the initial release of the Neuron Azure Service Bus Adapter which ships with Neuron 3.0!</p> <p>What follows is a lap around the core functionality of the adapter largely taken from the product documentation that ships with Neuron 3.0. I hope you will find the adapter interesting enough to take a closer look and even if hybrid cloud is not on your mind, there are literally hundreds of reasons to consider Neuron ESB for your messaging needs. </p> <h2><a name="_Toc347777630"><font color="#000000">Overview</font></a></h2> <p>Windows Azure Service Bus is a Platform as a Service (PaaS) capability provided by Microsoft that provides a highly robust messaging fabric hosted by Microsoft Windows Azure. </p> <p>Azure Service Bus extends on-premise messaging fabrics such as Neuron ESB by providing pub-sub messaging capable of traversing firewalls, a taxonomy for projecting entities and very simple orchestration capabilities via rules and actions.</p> <p>As shown below, Azure Service Bus bridges on-premise messaging capabilities enabling the ability to develop hybrid cloud applications that integrate with external services and service providers that are located behind the firewall allowing a new, modern breed of compositions to transcend traditional network, security and business boundaries.</p> <p><a href="http://www.code-magazine.com/ShowLargeArticleImage.aspx?QuickID=1112041&amp;Image=Garibay%20Figure%201.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image002" border="0" alt="clip_image002" src="http://rickgaribay.net/images/rickgaribay_net/Windows-Live-Writer/848795df03a9_13251/clip_image002_8b14d496-1968-495a-9002-9e285eb97cec.jpg" width="575" height="350" /></a></p> <p><b><i>Bridging ESBs in Hybrid Clouds </i></b><i>– Azure Service Bus extends on-premise messaging fabrics such as Neuron ESB enabling a next generation of hybrid cloud applications that transcend traditional network, security and business boundaries.</i></p> <p>There are two services supported by Azure Service Bus: </p> <ul> <li><b>Azure Service Bus Relay:</b> Serves as a push-based relay between two (or more) endpoints. A client and service (or services) establish an outbound, bi-directional socket connection over either TCP or HTTP on the relay and thus, messages from the client tunnel their way through the relay to the service. In this way, both the client and service are really peers on the same messaging fabric. </li> </ul> <p> </p> <ul> <li><b>Azure Service Bus Brokered Messaging: </b>Provides a pull-based durable message broker that supports queues, topics and subscriptions. A party wishing to send messages to Azure Service Bus establishes a TCP or HTTP connection to a queue or topic and pushes messages to the entity. A party wishing to receive messages from Azure Service Bus establishes a TCP or HTP connection and pulls messages from a queue or subscription. </li> </ul> <p>Neuron ESB 3.0 supports both Azure Service Bus services and this topic focuses on support of <a href="http://msdn.microsoft.com/en-us/library/windowsazure/ee732537.aspx">Azure Service Bus Brokered Messaging</a> via the Neuron Azure Service Bus Adapter.</p> <p>For more information on support for Azure Service Bus Relay support, please see “Azure Service Bus Integration” in the “Service Endpoints” topic in the Neuron ESB 3.0 product documentation.</p> <h2><a name="_Toc347777631"><font color="#000000">About the Neuron Azure Service Bus Adapter</font></a></h2> <p>The Neuron Azure Service Bus Adapter provides full support for the latest capabilities provided by the Windows Azure SDK version 1.7. </p> <p>Once the Neuron Azure Service Bus adapter is registered and an Adapter Endpoint is created, all configuration is managed through the property grid of the Adapter located on the properties tab of the Adapter Endpoint’s Details Pane:</p> <p><a href="http://rickgaribay.net/images/rickgaribay_net/Windows-Live-Writer/848795df03a9_13251/clip_image004_2.jpg"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image004" border="0" alt="clip_image004" src="http://rickgaribay.net/images/rickgaribay_net/Windows-Live-Writer/848795df03a9_13251/clip_image004_thumb.jpg" width="781" height="285" /></a></p> <p><b><i>Neuron Azure Service Bus Adapter – Property Grid </i></b><i>– All configurations for adapter is managed through the property grid. Properties are divided into 3 sections, General, Publish Mode Properties, and Subscribe Mode Properties.</i></p> <p>Please note that in order to connect to an Azure Service Bus entity with the Neuron Azure Service Bus adapter, you need to sign up for an Azure account and create an Azure Service Bus namespace with the required entities and ACS configuration. For more information, visit <a href="http://azure.com">http://azure.com</a></p> <h4><a name="_Toc347777632"><font color="#000000">Features</font></a></h4> <p>The Neuron Azure Service Bus adapter supports the following Azure Service Bus Brokered Messaging features:</p> <ul> <li>Send to Azure Service Bus Queue </li> <li>Send to Azure Service Bus Topic </li> <li>Receive from Azure Service Bus Queue </li> <li>Receive from Azure Service Bus Subscription </li> </ul> <p>In addition, the Neuron Azure Service Bus adapter simplifies the development experience by providing additional capabilities typical in production scenarios without the need to write custom code including:</p> <ul> <li>Smart Polling </li> <li>Eventual Consistency </li> <li>Transient Error Detection and Retry </li> </ul> <p>The Neuron Azure Service Bus adapter is installed as part of the core Neuron ESB installation. The adapter is packaged into a single assembly located within the <b>\Adapters</b> folder under the root of the default Neuron ESB installation directory:</p> <p>· Neuron.Esb.Adapters.AzureServiceBusAdapter.dll </p> <p>In addition, the following assembly is required and automatically installed in the root of the folder created for the service instance name:</p> <p>· Microsoft.ServiceBus.dll (Azure SDK version 1.7)</p> <p>To use the adapter, it must first be registered within the <i>Neuron ESB Explorer Adapter Registration Window</i>. Within the Adapter Registration Window, the adapter will appear with the name “<b>Azure Service Bus Adapter</b>”. Once registered, a new Adapter Endpoint can be created and configured with an instance name of your choice:</p> <p><a href="http://rickgaribay.net/images/rickgaribay_net/Windows-Live-Writer/848795df03a9_13251/clip_image006_2.jpg"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image006" border="0" alt="clip_image006" src="http://rickgaribay.net/images/rickgaribay_net/Windows-Live-Writer/848795df03a9_13251/clip_image006_thumb.jpg" width="780" height="509" /></a></p> <p><b><i>Neuron ESB Explorer Adapter Registration Window</i> -<i> Property Grid </i></b><i>– Before configuring the adapter instance for Publish or Subscribe mode, the adapter must first be registered.</i></p> <h4><a name="_Toc347777633"><font color="#000000">Supported Modes</font></a></h4> <p><font color="#000000">Once the initial registration is complete, the Neuron Azure Service Bus adapter can be configured in one of 2 modes: Publish and Subscribe. </font></p> <h4><a name="_Toc347777634"><font color="#000000">Publish</font></a></h4> <p>Publish mode allows Neuron ESB to monitor an Azure Service Bus Queue or Subscription by regularly polling, de-queuing all the messages, and publishing those messages to a Neuron ESB Topic. Messages are read synchronously via a one-way MEP.</p> <p><a href="http://rickgaribay.net/images/rickgaribay_net/Windows-Live-Writer/848795df03a9_13251/clip_image008_2.jpg"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image008" border="0" alt="clip_image008" src="http://rickgaribay.net/images/rickgaribay_net/Windows-Live-Writer/848795df03a9_13251/clip_image008_thumb.jpg" width="779" height="85" /></a></p> <p><b><i>Receiving Messages from Azure Service Bus </i></b><i>– When in Publish mode, the adapter supports receiving messages from an Azure Service Bus entity and publishing the messages on Neuron ESB.</i></p> <h6><font size="2">Configuration</font></h6> <p>Configuring the Publish mode of the Neuron Azure Service Bus adapter requires that minimally, the following properties are set:</p> <h6><font color="#000000" size="2">General Properties</font></h6> <ul> <li>Azure Service Bus Namespace Name - A registered namespace on Azure Service Bus. For example 'neudesic' would be the namespace for: sb://neudesic.servicebus.windows.net (for information on how to provision, configure and manage Azure Service Bus namespaces, please see the Azure Service Bus topic on <a href="http://azure.com">http://azure.com</a>). </li> <li>Azure ACS Issuer Name – The account/claim name for authenticating to the Windows Azure Access Control Service (ACS - For information on how to provision, configure and manage Azure Access Control namespaces, please see the Azure Access Control topic on <a href="http://azure.com">http://azure.com</a>). </li> <li>Azure ACS Key – The shared key used in conjunction with Azure ACS Issuer Name. </li> <li>Azure Entity Type - Queue or Subscription </li> <li>Azure Channel Type – Default, if outbound TCP port 9354 is open or HTTP to force communication over HTTP port 80/443 (In Default mode, the Neuron Azure Service Bus Adapter will try to connect via TCP. If outbound TCP port 9354 is not open, choose HTTP). </li> <li>Retry Count - The number of Service Bus operations retries to attempt in the event of a transient error (for more information on this setting, see the “Understanding Transient Error Detection and Retry” topic). </li> <li>Minimum Back-Off - The minimum number of seconds to wait before automatically retrying a Service Bus operation in the event that a transient error is encountered (for more information on this setting, see the “Understanding Transient Error Detection and Retry” topic). </li> <li>Maximum Back-Off - The maximum number of seconds to wait before automatically retrying a Service Bus operation in the event that a transient error is encountered (for more information on this setting, see the “Understanding Transient Error Detection and Retry” topic). </li> </ul> <h6><font size="2">Publish Properties</font></h6> <ul> <li>Azure Queue Name- The name of the queue that you want to receive messages from (this option appears when you choose “Queue” as the Azure Entity Type in General Properties). </li> <li>Azure Topic Name – The name of the topic that the subscription you want to receive messages from is associated with (this option appears when you choose “Topic” as the Azure Entity Type in General Properties). </li> <li>Azure Subscription Name - The name of the subscription you want to receive messages from (this option appears when you choose “Topic” as the Azure Entity Type in General Properties). </li> <li>Delete After Receive – False by default. If set to True, deletes the message from the queue or topic after it is received regardless of whether it is published to Neuron successfully (for more information on this setting, see the “Understanding Eventual Consistency” topic). </li> <li>Wait Duration - Duration (in seconds) to wait for a message on the queue or subscription to arrive before completing the poll request (for more information on this setting, see the “Understanding Smart Polling” topic). </li> <li>Neuron Publish Topic - The Neuron topic that messages will be published to. Required for Publish mode. </li> <li>Error Reporting – Determines how all errors are reported in the Windows Event Log and Neuron Logs. Either as Errors, Warnings or Information. </li> <li>Error on Polling – Register failed message and exception with Neuron Audit database. Please note that a valid SQL Server database must be configured and enabled. </li> <li>Audit Message on Failure - Determines if polling of data source continues on error and if consecutive errors are reported. </li> </ul> <p>The following shows the General configuration for an instance of the Neuron Azure Service Bus adapter called “Azure - Receive” in Publish mode:</p> <p><a href="http://rickgaribay.net/images/rickgaribay_net/Windows-Live-Writer/848795df03a9_13251/clip_image010_2.jpg"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image010" border="0" alt="clip_image010" src="http://rickgaribay.net/images/rickgaribay_net/Windows-Live-Writer/848795df03a9_13251/clip_image010_thumb.jpg" width="780" height="178" /></a></p> <p><b><i>Publish Mode General Configuration</i></b><i>– When in Publish mode, the adapter supports receiving messages from an Azure Service Bus entity and publishing the messages on Neuron ESB.</i></p> <p>The following shows the Properties configuration for a fully configured instance of the Neuron Azure Service Bus adapter in Publish mode:</p> <p><a href="http://rickgaribay.net/images/rickgaribay_net/Windows-Live-Writer/848795df03a9_13251/clip_image012_2.jpg"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image012" border="0" alt="clip_image012" src="http://rickgaribay.net/images/rickgaribay_net/Windows-Live-Writer/848795df03a9_13251/clip_image012_thumb.jpg" width="780" height="201" /></a></p> <p><b><i>Publish Mode Properties Configuration</i></b><i>– When in Publish mode, the adapter supports receiving messages from an Azure Service Bus entity and publishing the messages on Neuron ESB.</i></p> <h4><a name="_Toc347777635"><font color="#000000">Subscribe</font></a></h4> <p>Subscribe mode allows Neuron ESB to write messages that are published to Neuron ESB to an Azure Service Bus queue or topic. In this manner, Neuron ESB supports the ability to bridge an Azure Service Bus entity, allowing for on-premise parties to seamlessly communicate with Azure Service Bus. Once Neuron ESB receives a message, it sends the message to an Azure Service Bus Queue or Topic.</p> <p><a href="http://rickgaribay.net/images/rickgaribay_net/Windows-Live-Writer/848795df03a9_13251/clip_image014_2.jpg"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image014" border="0" alt="clip_image014" src="http://rickgaribay.net/images/rickgaribay_net/Windows-Live-Writer/848795df03a9_13251/clip_image014_thumb.jpg" width="779" height="85" /></a></p> <p><b><i>Sending Messages to Azure Service Bus </i></b><i>– When in Subscribe mode, the adapter supports sending messages published on Neuron ESB to an Azure Service Bus entity.</i></p> <h6><font size="2">Configuration</font></h6> <p>In addition to the General Properties covered under the Publish mode documentation, configuring the Subscribe mode of the Neuron Azure Service Bus adapter requires that minimally, the following properties are set:</p> <h6><font size="2">Subscribe Properties</font></h6> <ul> <li>Adapter Send Mode - Choose Asynchronous for maximum throughput or Synchronous for maximum reliability (for more information on this setting, see the “Choosing Synchronous vs. Asynchronous” topic). </li> <li>Adapter Queue Name - The name of the queue you want to send messages to (this option appears when you choose “Queue” as the Azure Entity Type in General Properties). </li> <li>Adapter Topic Name - The name of the topic you want to send messages to (this option appears when you choose “Topic” as the Azure Entity Type in General Properties). </li> </ul> <p>The following shows the General configuration for an instance of the Neuron Azure Service Bus adapter called “Azure - Send” in Subscribe mode:</p> <p><a href="http://rickgaribay.net/images/rickgaribay_net/Windows-Live-Writer/848795df03a9_13251/clip_image016_2.jpg"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image016" border="0" alt="clip_image016" src="http://rickgaribay.net/images/rickgaribay_net/Windows-Live-Writer/848795df03a9_13251/clip_image016_thumb.jpg" width="780" height="170" /></a></p> <p><b>S<em>ubscribe Mode General Configuration</em></b><em>– When in Subscribe mode, the adapter supports sending messages from Neuron ESB to an Azure Service Bus entity.</em></p> <p>The following shows the Properties configuration for a fully configured instance of the Neuron Azure Service Bus adapter in Subscribe mode:</p> <p><a href="http://rickgaribay.net/images/rickgaribay_net/Windows-Live-Writer/848795df03a9_13251/clip_image018_2.jpg"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image018" border="0" alt="clip_image018" src="http://rickgaribay.net/images/rickgaribay_net/Windows-Live-Writer/848795df03a9_13251/clip_image018_thumb.jpg" width="780" height="158" /></a></p> <p><b><i>Subscribe Mode General Configuration</i></b><i>– When in Subscribe mode, the adapter supports sending messages from Neuron ESB to an Azure Service Bus entity.</i></p> <h2><a name="_Toc347777636"><font color="#000000">Understanding Transient Error Detection and Retry</font></a></h2> <p><font color="#000000">When working with services in general and multi-tenant PaaS services in particular, it is important to understand that in order to scale to virtually hundreds of thousands of users/applications, most services like Azure Service Bus, SQL Azure,</font> etc. implement a throttling mechanism to ensure that the service remains available.</p> <p>This is particularly important when you have a process or application that is sending or receiving a high volume of messages because in these cases, there is a high likelihood that Azure Service Bus will throttle one or several requests. When this happens, a fault/HTTP error code is returned and it is important for your application to be able to detect this fault and attempt to remediate accordingly.</p> <p>Unfortunately, throttle faults are not the only errors that can occur. As with any service, security, connection and other unforeseen errors (exceptions) can and will occur, so the challenge becomes not only being able to identify the type of fault, but in addition, know what steps should be attempted to remediate. </p> <p>Per the guidance provided by the Azure Customer Advisory Team (<a href="http://windowsazurecat.com/2010/10/best-practices-for-handling-transient-conditions-in-sql-azure-client-applications/">http://windowsazurecat.com/2010/10/best-practices-for-handling-transient-conditions-in-sql-azure-client-applications/</a>), the Neuron Azure Service Bus adapter uses an exponential back-off based on the values provided for the Retry Count, Minimum Back-Off and Maximum Back-Off properties within the Properties tab for both Publish and Subscribe mode.</p> <p>Given a value of 3 retries, two seconds and ten seconds respectively, the adapter will automatically determine a value between two and ten and back off exponentially one time for each retry configured:</p> <p><a href="http://rickgaribay.net/images/rickgaribay_net/Windows-Live-Writer/848795df03a9_13251/clip_image020_2.jpg"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image020" border="0" alt="clip_image020" src="http://rickgaribay.net/images/rickgaribay_net/Windows-Live-Writer/848795df03a9_13251/clip_image020_thumb.jpg" width="780" height="158" /></a></p> <p><b><i>Exponential Back-Off Configuration</i></b><i>– The adapter will automatically detect transient exceptions/faults and retry by implementing an exponential back-off algorithm given a retry count, initial a<a href="http://rickgaribay.net/images/rickgaribay_net/Windows-Live-Writer/848795df03a9_13251/clip_image022_4.jpg"><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="clip_image022" border="0" alt="clip_image022" align="right" src="http://rickgaribay.net/images/rickgaribay_net/Windows-Live-Writer/848795df03a9_13251/clip_image022_thumb_1.jpg" width="111" height="293" /></a>nd max back-off configuration.</i></p> <p>Taking this example, as shown in the figure on the right, if the adapter chose an initial back-off of two seconds, in the event of a transient fault being detected (i.e. throttle, timeout, etc.) the adapter would wait two seconds before trying the operation again (i.e. sending or receiving a message) and exponentially increment the starting value until either the transient error disappears or the retry count is exceeded.</p> <p>In the event that the retry count is exceeded, the Neuron Azure Service Bus adapter will automatically persist a copy of the message in the audit database to ensure that no messages are lost (provided a SQL Server database has been configured).</p> <h2><a name="_Toc347777637"><font color="#000000">Understanding Smart Polling</font></a></h2> <p><font color="#000000">When <a href="http://rickgaribay.net/images/rickgaribay_net/Windows-Live-Writer/848795df03a9_13251/image_7.png"><img style="background-image: none; border-right-width: 0px; margin: 10px; padding-left: 0px; padding-right: 0px; display: inline; float: left; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" align="left" src="http://rickgaribay.net/images/rickgaribay_net/Windows-Live-Writer/848795df03a9_13251/image_thumb.png" width="161" height="240" /></a>configuring the Neuron Azure Service Bus Adapter in Publish mode, the adapter can take advantage of a Neuron ESB feature known as Smart Polling. </font></p> <p><font color="#000000">With Smart Polling, the adapter will connect to an Azure Service Bus queue or subscription and check for messages. If one or message is available, all messages will be immediately delivered (see “Understanding Eventual Consistency” for more information on supported read behaviors). </font></p> <p><font color="#000000">However, if no messages are available, the adapter will open a connection to the Azure Service Bus entity and wait for a specified timeout before attempting to initiate another poll request (essentially resulting in a long-polling behavior). In this manner, Azure Service Bus quotas are honored while ensuring that the adapter issues a receive request only when the configured timeout occurs as opposed to repeatedly polling the Azure Service Bus entity.</font></p> <h2><a name="_Toc347777638"><font color="#000000">Understanding Eventual Consistency</font></a></h2> <p><font color="#000000">When working with Azure Service Bus, it is important to note that the model for achieving consistency is different than traditional distributed transaction models. For example, when working with modern relational databases or spanning multiple services that are</font> composed into a logical unit of work (using WS-Atomic Transactions for example), it is a common expectation that work will either be performed completely or not at all. These types of transactions have the characteristics of being atomic, consistent, independent and durable (ACID). However, to achieve this level of consistency, a resource manager is required to coordinate the work being carried out by each service/database that participates in a logical transaction.</p> <p>Unfortunately, given the virtually unlimited scale of the web and cloud computing, it is impossible to deploy enough resource managers to account for the hundreds of thousands if not millions of resources required to achieve this level of consistency. Even if this were possible, the implications on achieving the scale and performance demanded by modern cloud-scale applications would be physically impossible.</p> <p>Of course, consistency is still as important for applications that participate in logical transactions across or consume cloud services. An alternative approach is to leverage an eventually consistent, or basically available, soft state, eventually consistent (BASE) approach to transactions. </p> <h6><font size="2">Ensuring Eventual Consistency in Publish Mode<a href="http://rickgaribay.net/images/rickgaribay_net/Windows-Live-Writer/848795df03a9_13251/image_10.png"><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/rickgaribay_net/Windows-Live-Writer/848795df03a9_13251/image_thumb_2.png" width="240" height="104" /></a></font></h6> <p>Azure Service Bus supports this model for scenarios that require consistency and the Neuron Azure Serviced Bus adapter makes taking advantage of this capability simply a matter of setting the “Delete After Receive” property (available in the Publish Mode Settings) to False, which is the default. </p> <p>When set to False, when receiving a message, the adapter will ensure that the message is not discarded from the Azure Service Bus entity until the message has been successfully published to Neuron ESB. In the event that an error occurs when attempting to publish a message, the message will be restored on the Azure Service Bus entity ensuring that it remains available for a subsequent attempt to receive the message (Please note that lock durations configured on the entity will affect the behavior of this feature. For more information, please refer to the Azure Service Bus documentation on MSDN: <a href="http://msdn.microsoft.com/en-us/library/ee732537.aspx">http://msdn.microsoft.com/en-us/library/ee732537.aspx</a>).</p> <h2><a name="_Toc347777639"><font color="#000000">Choosing Synchronous versus Asynchronous Receive</font></a></h2> <p><font color="#000000">When the Neuron Azure Service Bus adapter is configured in Subscribe mode, you can choose to send messages to an Azure Service Bus queue or topic in either synchronous or asynchronous mode by setting the <b><i>Adapter Send Mode </i></b>property to either “Asynchronous” or “Synchronous</font>” in the Subscribe Mode Property group. </p> <p>If reliability is a top priority such that the possibility of message loss cannot be tolerated, it is recommended that you choose Synchronous. In this mode, the adapter will transmit messages to an Azure Service Bus queue or topic at rate of about 4 or 5 per second. While it is possible to increase this throughput by adding additional adapters in subscribe mode, as a general rule, use this mode when choosing reliability at the expense of performance/throughput.</p> <p>To contrast, if performance/low-latency/throughput is a top priority, configuring the adapter to send asynchronously will result in significantly higher throughput (by several orders of magnitude). While the send performance in this mode is much higher, in the event of a catastrophic failure (server crash, out of memory exception) it is possible for messages that have left the Neuron ESB process but have not yet been transmitted to the Azure Service Bus (i.e. are in memory) the possibility for message loss is much higher than when in synchronous mode because of the significantly higher density of messages being transmitted. </p> <p><b></b></p> <h2><a name="_Toc347777640"><font color="#000000">Other Scenarios</font></a></h2> <h4><a name="_Toc347777641"><font color="#000000">Temporal Decoupling</font></a></h4> <p><font color="#000000"><a href="http://rickgaribay.net/images/rickgaribay_net/Windows-Live-Writer/848795df03a9_13251/clip_image024_2.jpg"><img style="background-image: none; border-right-width: 0px; margin: 10px; padding-left: 0px; padding-right: 0px; display: inline; float: left; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image024" border="0" alt="clip_image024" align="left" src="http://rickgaribay.net/images/rickgaribay_net/Windows-Live-Writer/848795df03a9_13251/clip_image024_thumb.jpg" width="133" height="157" /></a>One of the benefits of any queue-based messaging pattern is that the publisher/producer is decoupled from the subscribers/consumers. As a result, parties interested in a given message can be added and removed without any knowledge of the publisher/producer.</font></p> <p><font color="#000000">By persisting the message until</font> an interested party receives the message, the sending party is further decoupled from the receiving party because the receiving party need not be available at the time the message was written to persistence store. Azure Service Bus supports temporal decoupling with both queues and topics because they are durable entities.<a href="http://rickgaribay.net/images/rickgaribay_net/Windows-Live-Writer/848795df03a9_13251/clip_image026_2.jpg"><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="clip_image026" border="0" alt="clip_image026" align="right" src="http://rickgaribay.net/images/rickgaribay_net/Windows-Live-Writer/848795df03a9_13251/clip_image026_thumb.jpg" width="117" height="240" /></a></p> <p>As a result, a party that writes new order messages to an Azure Service Bus queue can do so uninhibitedly as shown below: </p> <p>When you configure an instance of the Neuron Azure Service Bus adapter in Publish mode, you can disable the adapter by unchecking the “Enabled” box. Any new messages written to the Azure Service Bus queue or subscription will persist until the adapter is enabled once again. </p> <p><b></b></p> <h4><a name="_Toc347777642"><font color="#000000">Competing Consumers</font></a></h4> <p><font color="#000000">Another messaging pattern that allows you to take advantage of the benefits of pull-based pub-sub model from a performance and scalability perspective is to adjust the number of consumers supported by the resources available to you</font> and keep adding consumers until throughput requirements are met.</p> <p>To take advantage of this pattern with the Neuron Azure Service Bus adapter and Azure Service Bus, simply add additional instances of the Publishing adapter as needed:</p> <p><a href="http://rickgaribay.net/images/rickgaribay_net/Windows-Live-Writer/848795df03a9_13251/clip_image028_2.jpg"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image028" border="0" alt="clip_image028" src="http://rickgaribay.net/images/rickgaribay_net/Windows-Live-Writer/848795df03a9_13251/clip_image028_thumb.jpg" width="568" height="277" /></a></p> <p><b><i>Competing Consumers </i></b><i>–Adding additional consumers with Neuron Azure Service Bus is simply a matter of adding additional instances of the Publishing adapter. </i></p> <h2><a name="_Toc347777643"><font color="#000000">Property Table</font></a></h2> <p> </p> <p>The following table provides details for each property exposed through the Neuron Explorer UI:</p> <table border="1" cellspacing="0" cellpadding="0"><tbody> <tr> <td valign="top" width="18%"> <p><b>Section Name</b></p> </td> <td valign="top" width="19%"> <p><b>Property Name</b></p> </td> <td valign="top" width="10%"> <p><b>Required</b></p> </td> <td valign="top" width="50%"> <p><b>Description</b></p> </td> </tr> <tr> <td valign="top" width="18%"> <p><i>General</i></p> </td> <td valign="top" width="19%"> </td> <td valign="top" width="10%"> </td> <td valign="top" width="50%"> <p><i>These properties are used for all modes of the adapter</i></p> </td> </tr> <tr> <td valign="top" width="18%"> </td> <td valign="top" width="19%"> <p>Azure Service Bus Namespace Name </p> </td> <td valign="top" width="10%"> <p>Yes</p> </td> <td valign="top" width="50%"> <p>A registered namespace on Azure Service Bus. For example 'neudesic' would be the namespace for: sb://neudesic.servicebus.windows.net </p> </td> </tr> <tr> <td valign="top" width="18%"> </td> <td valign="top" width="19%"> <p>Azure ACS Issuer Name </p> </td> <td valign="top" width="10%"> <p>Yes</p> </td> <td valign="top" width="50%"> <p>The account/claim name for authenticating to the Windows Azure Access Control Service (ACS) </p> </td> </tr> <tr> <td valign="top" width="18%"> </td> <td valign="top" width="19%"> <p>Azure ACS Key</p> </td> <td valign="top" width="10%"> <p>Yes</p> </td> <td valign="top" width="50%"> <p>The shared key used in conjunction with Azure ACS Issuer Name.</p> </td> </tr> <tr> <td valign="top" width="18%"> </td> <td valign="top" width="19%"> <p>Azure Entity Type </p> </td> <td valign="top" width="10%"> <p>Yes</p> </td> <td valign="top" width="50%"> <p><b>Default Queue. </b>Queue or Topic</p> </td> </tr> <tr> <td valign="top" width="18%"> </td> <td valign="top" width="19%"> <p>Azure Channel Type</p> </td> <td valign="top" width="10%"> <p>Yes</p> </td> <td valign="top" width="50%"> <p><b>Default is Default.</b> Default, if outbound TCP port 9354 is open or HTTP to force communication over HTTP port 80/443 </p> </td> </tr> <tr> <td valign="top" width="18%"> </td> <td valign="top" width="19%"> <p>Retry Count </p> </td> <td valign="top" width="10%"> <p>Yes</p> </td> <td valign="top" width="50%"> <p><b>Default 5. </b>The number of Service Bus operations retries to attempt in the event of a transient error (for more information on this setting, see the “Understanding Transient Error Detection and Retry” topic). </p> </td> </tr> <tr> <td valign="top" width="18%"> </td> <td valign="top" width="19%"> <p>Minimum Back Off</p> </td> <td valign="top" width="10%"> <p>Yes</p> </td> <td valign="top" width="50%"> <p><b>Default 3. </b>The minimum number of seconds to wait before automatically retrying a Service Bus operation in the event that a transient error is encountered (for more information on this setting, see the “Understanding Transient Error Detection and Retry” topic).</p> </td> </tr> <tr> <td valign="top" width="18%"> </td> <td valign="top" width="19%"> <p>Maximum Back Off</p> </td> <td valign="top" width="10%"> <p>Yes</p> </td> <td valign="top" width="50%"> <p><b>Default 3.</b> The maximum number of seconds to wait before automatically retrying a Service Bus operation in the event that a transient error is encountered (for more information on this setting, see the “Understanding Transient Error Detection and Retry” topic).</p> </td> </tr> <tr> <td valign="top" width="18%"> <p><i>Publish Properties</i></p> </td> <td valign="top" width="19%"> </td> <td valign="top" width="10%"> </td> <td valign="top" width="50%"> <p><i>These properties are only used when the adapter is in either Request/Response or Publish mode.</i></p> </td> </tr> <tr> <td valign="top" width="18%"> <p><i></i></p> </td> <td valign="bottom" width="19%"> <p>Azure Queue Name</p> </td> <td valign="top" width="10%"> <p>Yes</p> </td> <td valign="bottom" width="50%"> <p>The name of the queue that you want to receive messages from (this option appears when you choose “Queue” as the Azure Entity Type in General Properties).</p> </td> </tr> <tr> <td valign="top" width="18%"> <p><i></i></p> </td> <td valign="bottom" width="19%"> <p>Azure Topic Name </p> </td> <td valign="top" width="10%"> <p>Yes</p> </td> <td valign="bottom" width="50%"> <p>The name of the topic that the subscription you want to receive messages from is associated with (this option appears when you choose “Topic” as the Azure Entity Type in General Properties).</p> </td> </tr> <tr> <td valign="top" width="18%"> <p><i></i></p> </td> <td valign="bottom" width="19%"> <p>Azure Subscription Name </p> </td> <td valign="top" width="10%"> <p>Yes</p> </td> <td valign="bottom" width="50%"> <p>The name of the subscription you want to receive messages from (this option appears when you choose “Topic” as the Azure Entity Type in General Properties).</p> </td> </tr> <tr> <td valign="top" width="18%"> <p><i></i></p> </td> <td valign="bottom" width="19%"> <p>Delete After Receive</p> </td> <td valign="top" width="10%"> <p>Yes</p> </td> <td valign="bottom" width="50%"> <p><b>Default False</b>. If set to True, deletes the message from the queue or topic after it is received regardless of whether it is published to Neuron successfully (for more information on this setting, see the “Understanding Eventual </p> </td> </tr> <tr> <td valign="top" width="18%"> <p><i></i></p> </td> <td valign="bottom" width="19%"> <p>Wait Duration </p> </td> <td valign="top" width="10%"> <p>Yes</p> </td> <td valign="bottom" width="50%"> <p><b>Default 5.</b> Duration (in seconds) to wait for a message on the queue or subscription to arrive before completing the poll request (for more information on this setting, see the “Understanding Smart Polling” topic).</p> </td> </tr> <tr> <td valign="top" width="18%"> <p><i></i></p> </td> <td valign="bottom" width="19%"> <p>Neuron Publish Topic </p> </td> <td valign="top" width="10%"> <p>Yes</p> </td> <td valign="bottom" width="50%"> <p>The Neuron topic that messages will be published to. Required for Publish mode.</p> </td> </tr> <tr> <td valign="top" width="18%"> <p><i></i></p> </td> <td valign="bottom" width="19%"> <p>Error Reporting </p> </td> <td valign="top" width="10%"> <p>Yes</p> </td> <td valign="bottom" width="50%"> <p><b>Default Error. </b>Determines how all errors are reported in the Windows Event Log and Neuron Logs. Either as Errors, Warnings or Information.</p> </td> </tr> <tr> <td valign="top" width="18%"> <p><i></i></p> </td> <td valign="bottom" width="19%"> <p>Error on Polling</p> </td> <td valign="top" width="10%"> <p>Yes</p> </td> <td valign="bottom" width="50%"> <p><b>Default Stop Polling On Error. </b>Register failed message and exception with Neuron Audit database. Please note that a valid SQL Server database must be configured and enabled.</p> </td> </tr> <tr> <td valign="top" width="18%"> <p><i></i></p> </td> <td valign="bottom" width="19%"> <p>Audit Message on Failure </p> </td> <td valign="top" width="10%"> <p>Yes</p> </td> <td valign="bottom" width="50%"> <p><b>Default False. </b>Determines if polling of data source continues on error and if consecutive errors are reported.</p> </td> </tr> <tr> <td valign="top" width="18%"> <p><i>Subscribe Properties</i></p> </td> <td valign="top" width="19%"> </td> <td valign="top" width="10%"> </td> <td valign="top" width="50%"> <p><i>These properties are only used when the adapter is in either Solicit/Response or Request/Response mode.</i></p> </td> </tr> <tr> <td valign="top" width="18%"> <p><i></i></p> </td> <td valign="top" width="19%"> <p>Adapter Send Mode</p> </td> <td valign="top" width="10%"> <p>Yes</p> </td> <td valign="top" width="50%"> <p><b>Default Asynchronous. </b>Choose Asynchronous for maximum throughput or Synchronous for maximum reliability (for more information on this setting, see the “Choosing Synchronous vs. Asynchronous” topic).</p> </td> </tr> <tr> <td valign="top" width="18%"> <p><i></i></p> </td> <td valign="top" width="19%"> <p>Adapter Queue Name</p> </td> <td valign="top" width="10%"> <p>Yes</p> </td> <td valign="top" width="50%"> <p>The name of the queue you want to send messages to (this option appears when you choose “Queue” as the Azure Entity Type in General Properties).</p> </td> </tr> <tr> <td valign="top" width="18%"> <p><i></i></p> </td> <td valign="top" width="19%"> <p>Adapter Topic Name</p> </td> <td valign="top" width="10%"> <p>Yes</p> </td> <td valign="top" width="50%"> <p>The name of the topic you want to send messages to (this option appears when you choose “Topic” as the Azure Entity Type in General Properties).</p> </td> </tr> </tbody></table> <h2><a name="_Toc347777644"><font color="#000000">Message Format</font></a></h2> <p><font color="#000000">Azure Service Bus uses a proprietary message envelope called a </font><a href="http://msdn.microsoft.com/en-us/library/windowsazure/microsoft.servicebus.messaging.brokeredmessage.aspx"><font color="#000000">Brokered Message</font></a><font color="#000000"> as the unit of communication between all messaging entities including queues, topics and subscriptions.</font></p> <h4><a name="_Toc347777645"><font color="#000000">Publish Mode</font></a></h4> <p><font color="#000000">In Publish mode, the</font> Neuron Azure Service Bus Adapter will automatically map the body of the incoming Brokered Message to the Body property of the Neuron ESBMessage serializing the payload based on the detected encoding type as follows: </p> <p> </p> <p> </p><table border="1" cellspacing="0" cellpadding="0"><tbody> <tr> <td valign="top" width="282"> <p><b>BrokeredMessage.ContentType</b></p> </td> <td valign="top" width="254"> <p><b>ESBMessage.Header.BodyType</b></p> </td> </tr> <tr> <td valign="top" width="282"> <p>text/plain</p> </td> <td valign="top" width="254"> <p>text/plain</p> </td> </tr> <tr> <td valign="top" width="282"> <p>text/xml</p> </td> <td valign="top" width="254"> <p>text/xml</p> </td> </tr> <tr> <td valign="top" width="282"> <p>application/msbin-1</p> </td> <td valign="top" width="254"> <p>application/msbin-1</p> </td> </tr> <tr> <td valign="top" width="282"> <p>binary/bytes</p> </td> <td valign="top" width="254"> <p>binary/bytes</p> </td> </tr> <tr> <td valign="top" width="282"> <p>Other</p> </td> <td valign="top" width="254"> <p>text/xml</p> </td> </tr> </tbody></table> <p>Note per the table above that unless otherwise specified, the Neuron Azure Service Bus adapter will assume that the incoming message payload is text/xml. </p> <p>In addition, any properties stored in the Property property bag of the BrokeredMessage will be automatically mapped to the ESBMessage property bag provided the “Include Metadata” option is checked on the General tab in the Adapter Endpoints configuration. An exception to this rule is that the adapter will always map the BrokeredMessage.LockToken to the ESBMessage property bag with the same name regardless of whether “Include Metadata” is checked. </p> <h4><a name="_Toc347777646"><font color="#000000">Subscribe Mode</font></a></h4> <p>In Subscribe mode, the Neuron Azure Service Bus Adapter will automatically create a new Brokered Message for each transmission and map the body of an outgoing ESBMessage to the new message body as follows: </p> <p> </p> <p> </p><table border="1" cellspacing="0" cellpadding="0"><tbody> <tr> <td valign="top" width="282"> <p><b>ESBMessage.Header.BodyType</b></p> </td> <td valign="top" width="258"> <p><b>BrokeredMessage.ContentType</b></p> </td> </tr> <tr> <td valign="top" width="282"> <p>text/plain</p> </td> <td valign="top" width="258"> <p>text/plain</p> </td> </tr> <tr> <td valign="top" width="282"> <p>text/xml</p> </td> <td valign="top" width="258"> <p>text/xml</p> </td> </tr> <tr> <td valign="top" width="282"> <p>application/msbin-1</p> </td> <td valign="top" width="258"> <p>application/msbin-1</p> </td> </tr> <tr> <td valign="top" width="282"> <p>binary/bytes</p> </td> <td valign="top" width="258"> <p>binary/bytes</p> </td> </tr> <tr> <td valign="top" width="282"> <p>Other</p> </td> <td valign="top" width="258"> <p>text/xml</p> </td> </tr> </tbody></table> <p>In addition, any properties stored in the Property property bag of the ESBMessage will be automatically mapped to the BrokeredMessage property bag provided the “Include Metadata” option is checked on the General tab in the Adapter Endpoints configuration. </p> <h2><a name="_Toc347777647"><font color="#000000">Brokered Message Limitations</font></a></h2> <p>Note that the total payload size for Azure Service Bus messages is 256KB. The Neuron Azure Service Bus adapter will throw a runtime exception if a message greater than or equal to 256KB is sent and will save the message to the failed audit table. </p> <h2>Wrapping Up</h2> <p>Thanks for your interest and please don’t hesitate to hit me with questions, comments and feedback. If you see something missing, I’d love to hear from you as we are already starting to think about features for v.Next.</p> <p>I had a ton of fun writing this adapter and would like to that the Neuron product team for allowing me to make this small contribution to this incredible release.</p> <p>This adapter is just a small part of this major release and I hope this post has peeked your interest in <a href="http://products.neudesic.com/latest" target="_blank">checking out Neuron ESB</a>. Getting up and running is super simple and you can download the trial bits here: <a title="http://products.neudesic.com/" href="http://products.neudesic.com/">http://products.neudesic.com/</a></p><img src="http://rickgaribay.net/aggbug/355.aspx" width="1" height="1" /> Rick G. Garibay http://rickgaribay.net/archive/2013/02/26/introducing-the-neuron-azure-service-bus-adapter-for-neuron-3.0.aspx Tue, 26 Feb 2013 17:47:44 GMT http://rickgaribay.net/archive/2013/02/26/introducing-the-neuron-azure-service-bus-adapter-for-neuron-3.0.aspx#feedback 1 http://rickgaribay.net/comments/commentRss/355.aspx http://rickgaribay.net/services/trackbacks/355.aspx Interview on Magnanimous Software Net Cast http://rickgaribay.net/archive/2012/12/10/interview-on-magnanimous-software-net-cast.aspx <a href="http://msnetcast.com/" target="_blank"><img style="background-image: none; border-bottom: 0px; border-left: 0px; 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/rickgaribay_net/Windows-Live-Writer/Interview-on-Magnanimous-Software-Webcas_A3EE/image_3.png" width="244" height="208" /></a> <p>I had the honor of being interviewed by fellow MVP Magnus Mastersson (<a href="http://twitter.com/noopman" target="_blank">@noopman</a>) for his Magnanimous Software Podcast (love that name).</p> <p>Other than the dubious task of following really smart guys like Glenn Block and Mads Torgersen in this new series, we had a good chat about Neuron ESB, Azure Service Bus, BizTalk Server 2013, my book and other topics. In addition, Magnus managed to uncover some little known tidbits about my past <img style="border-bottom-style: none; border-left-style: none; border-top-style: none; border-right-style: none" class="wlEmoticon wlEmoticon-smile" alt="Smile" src="http://rickgaribay.net/images/rickgaribay_net/Windows-Live-Writer/Interview-on-Magnanimous-Software-Webcas_A3EE/wlEmoticon-smile_2.png" /></p> <p>The interview was a lot of fun and is now available here for your listening pleasure: <a href="http://msnetcast.com/0003/rick-garibay-wcf-biztalk-servicebus-book">http://msnetcast.com/0003/rick-garibay-wcf-biztalk-servicebus-book</a></p> <p>Links from the show:</p> <ul> <li>The podcast:<a href="http://msnetcast.com/0003/rick-garibay-wcf-biztalk-servicebus-book">http://msnetcast.com/0003/rick-garibay-wcf-biztalk-servicebus-book</a></li> <li>Neuron ESB:<a title="http://products.neudesic.com/" href="http://products.neudesic.com/">http://products.neudesic.com/</a> </li> <li>Windows Server AppFabric Cookbook:<a title="http://www.amazon.com/Microsoft-Windows-Server-AppFabric-Cookbook/dp/1849684189/" href="http://www.amazon.com/Microsoft-Windows-Server-AppFabric-Cookbook/dp/1849684189/">http://www.amazon.com/Microsoft-Windows-Server-AppFabric-Cookbook/dp/1849684189/</a> </li> <li>BizTalk Server: <a title="http://www.microsoft.com/biztalk/en/us/default.aspx" href="http://www.microsoft.com/biztalk/en/us/default.aspx">http://www.microsoft.com/biztalk/en/us/default.aspx</a>  </li> <li>Azure Service Bus Integration Services: <a title="http://msdn.microsoft.com/en-us/library/windowsazure/hh689864.aspx" href="http://msdn.microsoft.com/en-us/library/windowsazure/hh689864.aspx">http://msdn.microsoft.com/en-us/library/windowsazure/hh689864.aspx</a> </li> <li>Microsoft Case Study on Xerox Azure Hybrid Cloud Solution: <a title="http://www.microsoft.com/casestudies/Windows-Azure/Xerox-Corporation/Transportation-Solution-Provider-Screens-Commercial-Vehicles-with-Cloud-Service/710000000945" href="http://www.microsoft.com/casestudies/Windows-Azure/Xerox-Corporation/Transportation-Solution-Provider-Screens-Commercial-Vehicles-with-Cloud-Service/710000000945">http://www.microsoft.com/casestudies/Windows-Azure/Xerox-Corporation/Transportation-Solution-Provider-Screens-Commercial-Vehicles-with-Cloud-Service/710000000945</a> </li> </ul> <p>Thanks Magnus!</p><img src="http://rickgaribay.net/aggbug/352.aspx" width="1" height="1" /> Rick G. Garibay http://rickgaribay.net/archive/2012/12/10/interview-on-magnanimous-software-net-cast.aspx Mon, 10 Dec 2012 18:52:47 GMT http://rickgaribay.net/archive/2012/12/10/interview-on-magnanimous-software-net-cast.aspx#feedback http://rickgaribay.net/comments/commentRss/352.aspx http://rickgaribay.net/services/trackbacks/352.aspx Neuron ESB 2.5 Available for Download! http://rickgaribay.net/archive/2010/04/26/neuron-esb-2.5-available-for-download.aspx <p> </p> <p>Version 2.5 of our flagship messaging product, Neuron ESB is now available for <a href="http://www.neuronesb.com/esb-software-products/neuron-esb-what-is-new.aspx" target="_blank">download</a>.<a href="http://www.neuronesb.com/default.aspx"><img style="margin: 5px 0px; display: inline" alt="Neuron ESB - Neudesic Enterprise Service Bus Solution" align="right" src="http://www.neuronesb.com/resources/images/logos/neuronesb.jpg" /></a></p> <p>I’ve talked briefly about Neuron ESB <a href="http://rickgaribay.net/archive/2008/04/29/neuron-esb-2.0-rtm.aspx" target="_blank">here</a>, <a href="http://rickgaribay.net/archive/2008/12/18/microsoft-soa-and-business-process-conference-ndash-jan-28th-and.aspx" target="_blank">here</a> and <a href="http://rickgaribay.net/archive/2010/01/05/new-year-new-role.aspx" target="_blank">here</a> and you may have seen <a href="http://samgentile.com/" target="_blank">Sam Gentile</a>’s excellent treatment of the product here: <a title="http://samgentile.com/Web/neuron-esb/" href="http://samgentile.com/Web/neuron-esb/">http://samgentile.com/Web/neuron-esb/</a>. Neuron is the only commercial ESB built on WCF and the .NET Framework that is fully supported by a Microsoft Partner. We built Neuron ESB to accelerate SOA adoption by taking sophisticated messaging patterns such as Pub-Sub, Virtual Service, Naming and Discovery, Mediation, Protocol Bridging, and Security (to name a few) and commoditizing them so that they fall into the reach of developers of all disciplines and levels of experience, whether they are veteran WCF developers or have not yet made the leap.</p> <p>Put simply, Neuron is an Enterprise Service Bus (ESB) and integration platform built entirely with Microsoft technologies. While specific definitions of ESB’s vary, there is consistent agreement within the industry as to the types of capabilities an ESB should provide; Neuron provides all of these, and more. </p> <p>Some of the capabilities provided by Neuron ESB include: </p> <p><a href="http://rickgaribay.net/Images/CustomContent/NeuronESB2.5AvailableforDownload_FFEC/clip_image002.gif"><img style="border-bottom: 0px; border-left: 0px; margin: 5px; display: inline; border-top: 0px; border-right: 0px" title="clip_image002" border="0" alt="clip_image002" align="right" src="http://rickgaribay.net/Images/CustomContent/NeuronESB2.5AvailableforDownload_FFEC/clip_image002_thumb.gif" width="240" height="188" /></a></p> <p>· Message routing (content based, static, rules based)</p> <p>· Mediation (protocol bridging, LOB adapters)</p> <p>· Message processing (transformation, enhancement/augmentation)</p> <p>· Management (auditing, monitoring,, logging)</p> <p>· Quality of Service (security, delivery reliability, transactions)</p> <p>The diagram on the right depicts a fictional Neuron configuration illustrating interconnections in a heterogeneous environment, as well as the major Neuron functional components. You will notice that publishers publish or send messages to the bus on a topic. A topic is a network, or a channel that constrains communication to a business event. For example, there may be a number of different applications/systems that are interested in being notified with a customer places an order. Topics model the business domain, just like events, so any applications that are interested in orders can subscribe to the topic named “Orders”. The topic is configured with a messaging channel such as TCP which will provide very low latency, high throughput and excellent reliability. However, it will not guarantee message delivery in the event that a subscriber is not available at the time the message arrives. In this case, MSMQ might be a better choice. Other systems such as a WCF inventory service, fulfillment application hosted in an ERP or a CRM application might be interested in new orders, so they subscribe to the Orders topic. Now, when a publisher (such as a POS system) publishes a new order, each subscriber receives a notification. The notification may prompt the application to call a service (pull notification) or Neuron may deliver a message according to the interface of the application subscribing to the message. The latter enables the automation of a business process by orchestrating or composing several services to carry out a business process such as order fulfillment. <a href="http://rickgaribay.net/Images/CustomContent/NeuronESB2.5AvailableforDownload_FFEC/image.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; margin-left: 0px; border-top: 0px; margin-right: 0px; border-right: 0px" title="image" border="0" alt="image" align="left" src="http://rickgaribay.net/Images/CustomContent/NeuronESB2.5AvailableforDownload_FFEC/image_thumb.png" width="240" height="121" /></a></p> <p>Best of all, Neuron ESB integrates seamlessly with both Microsoft and other vendors. It provides WCF binding support out-of-the-box via Client Connectors and Service Connectors to enable WS-I Basic Profile messaging, WS-* and REST. In addition, it provides traditional integration via adapters for working with SQL Server, CRM, Sharepoint, SMTP and FTP to name just a few. Neuron ESB also integrates directly with BizTalk Server via a dedicated BizTalk channel that enables publishers to send and receive messages via the BizTalk MessageBox. This allows customers to expand the reach of the their BizTalk solutions while continuing to build upon their investments in BizTalk Server. The key objective is to allow customers to continue to leverage their existing investments while streamlining development efforts so that you can focus more on adding business value and less on the plumbing.</p> <p> </p> <p>There is much more to Neuron ESB than I can capture in this quick blog post, but some additional benefits of Neuron ESB include the ability to:</p> <p><strong>— Quickly integrate your systems and applications</strong></p> <p>◦ Insert/retrieve data from databases with no coding</p> <p>◦ Interconnect heterogeneous systems, legacy applications, and the newest technologies with no coding</p> <p><strong>— Leverage your existing assets</strong></p> <p>◦ Utilize current developer skills. No retraining, or special tools required</p> <p>◦ Use adapters to connect to your applications and systems</p> <p><strong>— Easily extend your applications</strong></p> <p>◦ Add workflow with no coding</p> <p>◦ Add pipelines, with rules, transformation, logic, etc., with no coding</p> <p><strong>— Gain visibility into your business</strong></p> <p>◦ Extract basic information from messages for business indicators</p> <p>◦ Populate data warehouses, and analysis stores in real time</p> <p><strong>— Create a powerful, reusable infrastructure</strong></p> <p>◦ Common code is in the ESB, not applications</p> <p>◦ IT resources can manage infrastructure with no impact to applications/services</p> <p>◦ Evolves with you, and in support of your objectives</p> <p>◦ Get monitoring, management, admin for “free”</p> <p>◦ Utilize industry standards</p> <p>We are very excited to make this new release available for evaluation. You can find more information about Neuron ESB 2.5 here: <a title="http://www.neuronesb.com/default.aspx" href="http://www.neuronesb.com/default.aspx">http://www.neuronesb.com/default.aspx</a></p> <p>If you have any questions, would like a demo or want to talk about some of the key scenarios that Neuron can help you attain, please don’t hesitate to contact me.</p><img src="http://rickgaribay.net/aggbug/280.aspx" width="1" height="1" /> Rick G. Garibay http://rickgaribay.net/archive/2010/04/26/neuron-esb-2.5-available-for-download.aspx Tue, 27 Apr 2010 01:12:05 GMT http://rickgaribay.net/archive/2010/04/26/neuron-esb-2.5-available-for-download.aspx#feedback http://rickgaribay.net/comments/commentRss/280.aspx http://rickgaribay.net/services/trackbacks/280.aspx