<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" version="2.0">
  <channel>
    <title>Clemens Vasters</title>
    <link>http://vasters.com/clemensv/</link>
    <description>Cloud Development and Alien Abductions</description>
    <language>en-us</language>
    <copyright>Clemens Vasters</copyright>
    <lastBuildDate>Wed, 23 Jan 2013 08:03:46 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 1.9.7067.0</generator>
    <managingEditor>cvasters@guhhome.com</managingEditor>
    <webMaster>cvasters@guhhome.com</webMaster>
    <item>
      <trackback:ping>http://vasters.com/clemensv/Trackback.aspx?guid=36989ffc-6c04-4ac0-910d-848b11f00faf</trackback:ping>
      <pingback:server>http://vasters.com/clemensv/pingback.aspx</pingback:server>
      <pingback:target>http://vasters.com/clemensv/PermaLink,guid,36989ffc-6c04-4ac0-910d-848b11f00faf.aspx</pingback:target>
      <dc:creator>
      </dc:creator>
      <wfw:comment>http://vasters.com/clemensv/CommentView,guid,36989ffc-6c04-4ac0-910d-848b11f00faf.aspx</wfw:comment>
      <wfw:commentRss>http://vasters.com/clemensv/SyndicationService.asmx/GetEntryCommentsRss?guid=36989ffc-6c04-4ac0-910d-848b11f00faf</wfw:commentRss>
      <slash:comments>2</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p align="center">
          <iframe style="height: 288px; width: 512px" src="http://channel9.msdn.com/Blogs/Subscribe/Service-Bus-Notification-Hubs-Code-Walkthrough-Windows-8-Edition/player?w=512&amp;h=288" frameborder="0" scrolling="no">
          </iframe>
        </p>
        <p>
          <em>
          </em>
        </p>
        <p>
          <em>Service Bus Notification Hubs </em>are a brand new intrinsic feature of Windows
Azure Service Bus and are different from other push notification services in four
key areas:
</p>
        <ul>
          <li>
Complete client registration management. Your backend application (if you even have
one) does not need to worry at all about device-ids or channels or other particulars
of push notifications and doesn't need to cooperate in management. It doesn't even
have to be a web app that's publicly accessible.   
</li>
          <li>
Platform independence. Service Bus Notification Hubs allow cross-platform push notifications
so that iOS Alerts and Windows Live Tiles can be targeted with a single event message.  
</li>
          <li>
Broadcast and tag-based Multicast - Service Bus Notification Hubs are optimized around
automatic notification broadcast to many thousand devices with low latency. One message
in, thousands of notifications out. 
</li>
          <li>
Mass customization - Notification Hub notification templates allow for customization
of notification delivery for each individual registration, allowing each instance
of a client App to choose how it wants to receive events. 
</li>
        </ul>
        <p>
In this preview, Notification Hubs are able to push notifications to Windows Store
apps and iOS apps from .NET back-ends. Support for Android and Windows Phone, along
with additional back-end technologies (including Windows Azure Mobile Services) will
be added soon.
</p>
        <p>
After the basic intro, I'm showing how to create and provision a Windows 8 application
from scratch, how to hook it up to a new Notification Hub, and send it a notification
"Toast" using the portals and Visual Studio 2012. (The equivalent iOS walkthrough
will follow later this week)
</p>
        <p>
For those of you with a "TL;DW" attention span (too long; didn't watch),
here's the whole extent of the code added to the stock Windows Store Grid template
to enable Service Bus Notifications and that includes re-registering existing registrations
at App startup. 5 lines without cosmetic wrapping and some massaging of XML for the
template:
</p>
        <p>
          <font face="Courier New">public App() 
<br />
{ 
<br />
    var cn = ConnectionString.CreateUsingSharedAccessSecretWithListenAccess( 
<br />
            "sb://clemensv1.servicebus.windows.net", 
<br />
            "{{secret-key}}"); 
<br />
    this.notificationHub = new NotificationHub("myhub", cn);</font>
        </p>
        <p>
          <font face="Courier New">    ... 
<br />
}</font>
        </p>
        <p>
          <font face="Courier New">async Task InitNotificationsAsync() 
<br />
{ 
<br />
    await notificationHub.RefreshRegistrationsAsync(); 
<br /><br />
    if (!await notificationHub.RegistrationExistsForApplicationAsync("myToast")) 
<br />
    { 
<br />
        await notificationHub.CreateTemplateRegistrationForApplicationAsync( 
<br />
            CreateTemplate(),
"myToast"); 
<br />
    } 
<br />
} 
<br />
         
<br />
XmlDocument CreateTemplate() 
<br />
{ 
<br />
    var t = ToastNotificationManager.GetTemplateContent(ToastTemplateType.ToastText01); 
<br />
    var n = t.SelectSingleNode("//text[@id='1']") as XmlElement; 
<br />
    if (n != null) 
<br />
    { 
<br />
        n.InnerText = "$(msg)"; 
<br />
    } 
<br />
    return t; 
<br />
}</font>
        </p>
        <p>
The event-source code is similarly terse:
</p>
        <p>
          <font face="Courier New">var cn = ServiceBusConnectionStringBuilder.CreateUsingSharedAccessSecretWithFullAccess( 
<br />
    "clemensv1", "{{{secret key}}"); 
<br /><br />
var hubClient = NotificationHubClient. 
<br />
    CreateClientFromConnectionString(cn, "myhub"); 
<br /><br />
hubClient.SendTemplateNotification(new Dictionary&lt;string, string&gt;{ 
<br />
    { "msg", TextBox1.Text }});</font>
        </p>
        <p>
3 lines. Three lines. No management of device ids. No public endpoint for the phone
to talk to. Service Bus does all that. It really is worth playing with. 
</p>
        <p>
And here are all the key links ....
</p>
        <ul>
          <li>
            <span>Feature guide (Windows Store Apps) - </span>
            <a href="http://go.microsoft.com/fwlink/?LinkID=275828">http://go.microsoft.com/fwlink/?LinkID=275828</a>
          </li>
          <li>
            <span>Feature guide (iOS) -  </span>
            <a href="http://go.microsoft.com/fwlink/?LinkId=275829">http://go.microsoft.com/fwlink/?LinkId=275829</a>
          </li>
          <li>
            <span>Fundamentals - </span>
            <a href="http://go.microsoft.com/fwlink/?LinkId=277072">http://go.microsoft.com/fwlink/?LinkId=277072</a>
          </li>
          <li>
            <span>Tutorial (Windows Store Apps) - </span>
            <a href="http://go.microsoft.com/fwlink/?LinkId=277073">http://go.microsoft.com/fwlink/?LinkId=277073</a>
          </li>
          <li>
            <span>Tutorial (iOS) - </span>
            <a href="http://go.microsoft.com/fwlink/?LinkId=277074">http://go.microsoft.com/fwlink/?LinkId=277074</a>
          </li>
        </ul>
        <p>
SDKs:
</p>
        <ul>
          <li>
            <strong>Windows 8 Managed Client Library -</strong> <a href="http://go.microsoft.com/fwlink/?LinkID=277160">http://go.microsoft.com/fwlink/?LinkID=277160</a></li>
          <li>
            <strong>iOS Client Library - </strong>
            <a href="http://go.microsoft.com/fwlink/?LinkID=277161">http://go.microsoft.com/fwlink/?LinkID=277161</a>
          </li>
          <li>
            <strong>Preview client NuGet -</strong> <a href="http://nuget.org/packages/ServiceBus.Preview">http://nuget.org/packages/ServiceBus.Preview</a></li>
        </ul>
        <img width="0" height="0" src="http://vasters.com/clemensv/aggbug.ashx?id=36989ffc-6c04-4ac0-910d-848b11f00faf" />
      </body>
      <title>Service Bus Notification Hubs &amp;ndash; Concepts and Code Walkthrough - Windows 8 Edition</title>
      <guid isPermaLink="false">http://vasters.com/clemensv/PermaLink,guid,36989ffc-6c04-4ac0-910d-848b11f00faf.aspx</guid>
      <link>http://vasters.com/clemensv/2013/01/23/Service+Bus+Notification+Hubs+Ndash+Concepts+And+Code+Walkthrough+Windows+8+Edition.aspx</link>
      <pubDate>Wed, 23 Jan 2013 08:03:46 GMT</pubDate>
      <description>&lt;p align="center"&gt;
&lt;iframe style="height: 288px; width: 512px" src="http://channel9.msdn.com/Blogs/Subscribe/Service-Bus-Notification-Hubs-Code-Walkthrough-Windows-8-Edition/player?w=512&amp;amp;h=288" frameborder="0" scrolling="no"&gt;
&lt;/iframe&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;em&gt;&lt;/em&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;em&gt;Service Bus Notification Hubs &lt;/em&gt;are a brand new intrinsic feature of Windows
Azure Service Bus and are different from other push notification services in four
key areas:
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
Complete client registration management. Your backend application (if you even have
one) does not need to worry at all about device-ids or channels or other particulars
of push notifications and doesn't need to cooperate in management. It doesn't even
have to be a web app that's publicly accessible.&amp;#160;&amp;#160; 
&lt;/li&gt;
&lt;li&gt;
Platform independence. Service Bus Notification Hubs allow cross-platform push notifications
so that iOS Alerts and Windows Live Tiles can be targeted with a single event message.&amp;#160; 
&lt;/li&gt;
&lt;li&gt;
Broadcast and tag-based Multicast - Service Bus Notification Hubs are optimized around
automatic notification broadcast to many thousand devices with low latency. One message
in, thousands of notifications out. 
&lt;/li&gt;
&lt;li&gt;
Mass customization - Notification Hub notification templates allow for customization
of notification delivery for each individual registration, allowing each instance
of a client App to choose how it wants to receive events. 
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
In this preview, Notification Hubs are able to push notifications to Windows Store
apps and iOS apps from .NET back-ends. Support for Android and Windows Phone, along
with additional back-end technologies (including Windows Azure Mobile Services) will
be added soon.
&lt;/p&gt;
&lt;p&gt;
After the basic intro, I'm showing how to create and provision a Windows 8 application
from scratch, how to hook it up to a new Notification Hub, and send it a notification
&amp;quot;Toast&amp;quot; using the portals and Visual Studio 2012. (The equivalent iOS walkthrough
will follow later this week)
&lt;/p&gt;
&lt;p&gt;
For those of you with a &amp;quot;TL;DW&amp;quot; attention span (too long; didn't watch),
here's the whole extent of the code added to the stock Windows Store Grid template
to enable Service Bus Notifications and that includes re-registering existing registrations
at App startup. 5 lines without cosmetic wrapping and some massaging of XML for the
template:
&lt;/p&gt;
&lt;p&gt;
&lt;font face="Courier New"&gt;public App() 
&lt;br /&gt;
{ 
&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160; var cn = ConnectionString.CreateUsingSharedAccessSecretWithListenAccess( 
&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;quot;sb://clemensv1.servicebus.windows.net&amp;quot;, 
&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;quot;{{secret-key}}&amp;quot;); 
&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160; this.notificationHub = new NotificationHub(&amp;quot;myhub&amp;quot;, cn);&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="Courier New"&gt;&amp;#160;&amp;#160;&amp;#160; ... 
&lt;br /&gt;
}&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="Courier New"&gt;async Task InitNotificationsAsync() 
&lt;br /&gt;
{ 
&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160; await notificationHub.RefreshRegistrationsAsync(); 
&lt;br /&gt;
&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160; if (!await notificationHub.RegistrationExistsForApplicationAsync(&amp;quot;myToast&amp;quot;)) 
&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160; { 
&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; await notificationHub.CreateTemplateRegistrationForApplicationAsync( 
&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; CreateTemplate(),
&amp;quot;myToast&amp;quot;); 
&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160; } 
&lt;br /&gt;
} 
&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 
&lt;br /&gt;
XmlDocument CreateTemplate() 
&lt;br /&gt;
{ 
&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160; var t = ToastNotificationManager.GetTemplateContent(ToastTemplateType.ToastText01); 
&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160; var n = t.SelectSingleNode(&amp;quot;//text[@id='1']&amp;quot;) as XmlElement; 
&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160; if (n != null) 
&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160; { 
&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; n.InnerText = &amp;quot;$(msg)&amp;quot;; 
&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160; } 
&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160; return t; 
&lt;br /&gt;
}&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
The event-source code is similarly terse:
&lt;/p&gt;
&lt;p&gt;
&lt;font face="Courier New"&gt;var cn = ServiceBusConnectionStringBuilder.CreateUsingSharedAccessSecretWithFullAccess( 
&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160; &amp;quot;clemensv1&amp;quot;, &amp;quot;{{{secret key}}&amp;quot;); 
&lt;br /&gt;
&lt;br /&gt;
var hubClient = NotificationHubClient. 
&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160; CreateClientFromConnectionString(cn, &amp;quot;myhub&amp;quot;); 
&lt;br /&gt;
&lt;br /&gt;
hubClient.SendTemplateNotification(new Dictionary&amp;lt;string, string&amp;gt;{ 
&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160; { &amp;quot;msg&amp;quot;, TextBox1.Text }});&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
3 lines. Three lines. No management of device ids. No public endpoint for the phone
to talk to. Service Bus does all that. It really is worth playing with. 
&lt;/p&gt;
&lt;p&gt;
And here are all the key links ....
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;span&gt;Feature guide (Windows Store Apps) - &lt;/span&gt;&lt;a href="http://go.microsoft.com/fwlink/?LinkID=275828"&gt;http://go.microsoft.com/fwlink/?LinkID=275828&lt;/a&gt; 
&lt;/li&gt;
&lt;li&gt;
&lt;span&gt;Feature guide (iOS) -&amp;#160; &lt;/span&gt;&lt;a href="http://go.microsoft.com/fwlink/?LinkId=275829"&gt;http://go.microsoft.com/fwlink/?LinkId=275829&lt;/a&gt; 
&lt;/li&gt;
&lt;li&gt;
&lt;span&gt;Fundamentals - &lt;/span&gt;&lt;a href="http://go.microsoft.com/fwlink/?LinkId=277072"&gt;http://go.microsoft.com/fwlink/?LinkId=277072&lt;/a&gt; 
&lt;/li&gt;
&lt;li&gt;
&lt;span&gt;Tutorial (Windows Store Apps) - &lt;/span&gt;&lt;a href="http://go.microsoft.com/fwlink/?LinkId=277073"&gt;http://go.microsoft.com/fwlink/?LinkId=277073&lt;/a&gt; 
&lt;/li&gt;
&lt;li&gt;
&lt;span&gt;Tutorial (iOS) - &lt;/span&gt;&lt;a href="http://go.microsoft.com/fwlink/?LinkId=277074"&gt;http://go.microsoft.com/fwlink/?LinkId=277074&lt;/a&gt; 
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
SDKs:
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Windows 8 Managed Client Library -&lt;/strong&gt;&amp;#160;&lt;a href="http://go.microsoft.com/fwlink/?LinkID=277160"&gt;http://go.microsoft.com/fwlink/?LinkID=277160&lt;/a&gt; 
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;iOS Client Library - &lt;/strong&gt;&lt;a href="http://go.microsoft.com/fwlink/?LinkID=277161"&gt;http://go.microsoft.com/fwlink/?LinkID=277161&lt;/a&gt; 
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Preview client NuGet -&lt;/strong&gt;&amp;#160;&lt;a href="http://nuget.org/packages/ServiceBus.Preview"&gt;http://nuget.org/packages/ServiceBus.Preview&lt;/a&gt; 
&lt;/li&gt;
&lt;/ul&gt;
&lt;img width="0" height="0" src="http://vasters.com/clemensv/aggbug.ashx?id=36989ffc-6c04-4ac0-910d-848b11f00faf" /&gt;</description>
      <comments>http://vasters.com/clemensv/CommentView,guid,36989ffc-6c04-4ac0-910d-848b11f00faf.aspx</comments>
    </item>
    <item>
      <trackback:ping>http://vasters.com/clemensv/Trackback.aspx?guid=4718bf97-cc2e-46ba-854a-f4a1d93fb2a9</trackback:ping>
      <pingback:server>http://vasters.com/clemensv/pingback.aspx</pingback:server>
      <pingback:target>http://vasters.com/clemensv/PermaLink,guid,4718bf97-cc2e-46ba-854a-f4a1d93fb2a9.aspx</pingback:target>
      <dc:creator>
      </dc:creator>
      <wfw:comment>http://vasters.com/clemensv/CommentView,guid,4718bf97-cc2e-46ba-854a-f4a1d93fb2a9.aspx</wfw:comment>
      <wfw:commentRss>http://vasters.com/clemensv/SyndicationService.asmx/GetEntryCommentsRss?guid=4718bf97-cc2e-46ba-854a-f4a1d93fb2a9</wfw:commentRss>
      <slash:comments>3</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
          <a href="http://en.wikipedia.org/wiki/File:ESB.png">
            <img style="BORDER-LEFT-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px; BACKGROUND-IMAGE: none; BORDER-BOTTOM-WIDTH: 0px; FLOAT: right; PADDING-TOP: 0px; PADDING-LEFT: 0px; MARGIN: 2px 0px 2px 5px; DISPLAY: inline; PADDING-RIGHT: 0px; BORDER-TOP-WIDTH: 0px" border="0" alt="File:ESB.png" align="right" src="http://upload.wikimedia.org/wikipedia/commons/thumb/8/80/ESB.png/751px-ESB.png" width="300" height="240" />
          </a>The
basic idea of the Enterprise Service Bus paints a wonderful picture of a harmonious
coexistence, integration, and collaboration of software services. Services for a particular
general cause are built or procured once and reused across the Enterprise by ways
of publishing them and their capabilities in a corporate services repository from
where they can be discovered. The repository holds contracts and policy that allows
dynamically generating functional adapters to integrate with services. Collaboration
and communication is virtualized through an intermediary layer that knows how to translate
messages from and to any other service hooked into the ESB like a babel fish in the
Hitchhiker’s Guide to the Galaxy. The ESB is a bus, meaning it aspires to be a smart,
virtualizing, mediating, orchestrating messaging substrate permeating the Enterprise,
providing uniform and mediated access anytime and anywhere throughout today’s global
Enterprise. That idea is so beautiful, it rivals My Little Pony. Sadly, it’s also
about as realistic. We tried regardless.
</p>
        <p>
As with many utopian ideas, before we can get to the pure ideal of an ESB, there’s
some less ideal and usually fairly ugly phase involved where non-conformant services
are made conformant. Until they are turned into WS-* services, any CICS transaction
and SAP BAPI is fronted with a translator and as that skinning renovation takes place,
there’s also some optimization around message flow, meaning messages get batched or
de-batched, enriched or reduced. In that phase, there was also learning of the value
and lure of the benefits of central control. SOA Governance is an interesting idea
to get customers drunk on. That ultimately led to cheating on the ‘B’. When you look
around and look at products proudly carrying the moniker ‘Enterprise Service Bus’
you will see hubs. In practice, the B in ESB is mostly just a lie. Some vendors sell
ESB servers, some even sell ESB appliances. If you need to walk to a central place
to talk to anyone, it’s a hub. Not a bus. 
</p>
        <p>
Yet, the bus does exist. The IP network is the bus. It turns out to suit us well on
the Internet. Mind that I’m explicitly talking about “IP network” and not “Web” as
I do believe that there are very many useful protocols beyond HTTP. The Web is obviously
the banner example for a successful implementation of services on the IP network that
does just fine without any form of centralized services other than the highly redundant
domain name system. 
</p>
        <p>
Centralized control over services does not scale in any dimension. Intentionally creating
a bottleneck through a centrally controlling committee of ESB machines, however far
scaled out, is not a winning proposition in a time where every potential or actual
customer carries a powerful computer in their pockets allowing to initiate ad-hoc
transactions at any time and from anywhere and where we see vehicles, machines and
devices increasingly spew out telemetry and accept remote control commands. Central
control and policy driven governance over all services in an Enterprise also kills
all agility and reduces the ability to adapt services to changing needs because governance
invariably implies process and certification. Five-year plan, anyone? 
</p>
        <p>
If the ESB architecture ideal weren’t a failure already, the competitive pressure
to adopt direct digital interaction with customers via Web and Apps, and therefore
scale up not to the scale of the enterprise, but to scale up to the scale of the enterprise’s
customer base will seal its collapse. 
</p>
        <h3>Service Orientation
</h3>
        <p>
While the ESB as a concept permeating the entire Enterprise is dead, the related notion
of Service Orientation is thriving even though the <a href="http://msdn.microsoft.com/en-us/library/ff648318.aspx#SOATenets">four
tenets of SOA</a> are rarely mentioned anymore. HTTP-based services on the Web embrace
explicit message passing. They mostly do so over the baseline application contract
and negotiated payloads that the HTTP specification provides for. In the case of SOAP
or XML-RPC, they are using abstractions on top that have their own application protocol
semantics. Services are clearly understood as units of management, deployment, and
versioning and that understanding is codified in most platform-as-a-service offerings. 
</p>
        <p>
That said, while explicit boundaries, autonomy, and contract sharing have been clearly
established, the notion of policy-driven compatibility – arguably a political addition
to the list to motivate WS-Policy as the time – has generally been replaced by something
even more powerful: Code. JavaScript code to be more precise. Instead of trying to
tell a generic client how to adapt to service settings by ways of giving it a complex
document explaining what switches to turn, clients now get code that turns the switches
outright. The successful alternative is to simply provide no choice. There’s one way
to gain access authorization for a service, period. The “policy” is in the docs. 
</p>
        <p>
The REST architecture model is service oriented – and I am not meaning to imply that
it is so because of any particular influence. The foundational principles were becoming
common sense around the time when these terms were coined and as the notion of broadly
interoperable programmable services started to gain traction in the late 1990s – the
subsequent grand dissent that arose was around whether pure HTTP was sufficient to
build these services, or whether the ambitious multi-protocol abstraction for WS-*
would be needed. I think it’s fairly easy to declare the winner there. 
</p>
        <h3>Federated Autonomous Services
</h3>
        <p>
          <a href="http://vasters.com/clemensv/content/binary/Windows-Live-Writer/Utopia-ESB_87DD/image_2.png">
            <img title="image" style="BORDER-LEFT-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px; BACKGROUND-IMAGE: none; BORDER-BOTTOM-WIDTH: 0px; FLOAT: right; PADDING-TOP: 0px; PADDING-LEFT: 0px; DISPLAY: inline; PADDING-RIGHT: 0px; BORDER-TOP-WIDTH: 0px" border="0" alt="image" align="right" src="http://vasters.com/clemensv/content/binary/Windows-Live-Writer/Utopia-ESB_87DD/image_thumb.png" width="240" height="213" />
          </a>Windows
Azure, to name a system that would surely be one to fit the kind of solution complexity
that ESBs were aimed at, is a very large distributed system with a significant number
of independent multi-tenant services and deployments that are spread across many data
centers. In addition to the publicly exposed capabilities, there are quite a number
of “invisible” services for provisioning, usage tracking and analysis, billing, diagnostics,
deployment, and other purposes.  Some components of these internal services integrate
with external providers. Windows Azure doesn’t use an ESB. Windows Azure is a federation
of autonomous services.
</p>
        <p>
The basic shape of each of these services is effectively identical and that’s not
owing, at least not to my knowledge, to any central architectural directive even though
the services that shipped after the initial wave certainly took a good look at the
patterns that emerged. Practically all services have a gateway whose purpose it is
to handle and dispatch and sometimes preprocess incoming network requests or sessions
and a backend that ultimately fulfills the requests. The services interact through
public IP space, meaning that if Service Bus wants to talk to its SQL Database backend
it is using a public IP address and not some private IP. The Internet is the bus.
The backend and its structure is entirely a private implementation matter.  It
could be a single role or many roles. 
</p>
        <p>
Any gateway’s job is to provide network request management, which includes establishing
and maintaining sessions, session security and authorization, API versioning where
multiple variants of the same API are often provided in parallel, usage tracking,
defense mechanisms, and diagnostics for its areas of responsibility. This functionality
is specific and inherent to the service. And it’s not all HTTP. SQL database has a
gateway that speaks the Tabular Data Stream protocol (TDS) over TCP, for instance,
and Service Bus has a gateway that speaks AMQP and the binary proprietary Relay and
Messaging protocols.
</p>
        <p>
Governance and diagnostics doesn’t work by putting a man in the middle and watching
the traffic coming by, which is akin to trying the tell whether a business is healthy
by counting the trucks going to their warehouse. Instead we are integrating the data
feeds that come out of the respective services and are generated fully knowing the
internal state, and concentrate these data streams, like the billing stream, in yet
other services that are also autonomous and have their own gateways. All these services
interact and integrate even though they’re built by a composite team far exceeding
the scale of most Enterprise’s largest projects, and while teams run on separate schedules
where deployments into the overall system happen multiple times daily. It works because
each service owns its gateway, is explicit about its versioning strategy, and has
a very clear mandate to honor published contracts, which includes explicit regression
testing. It would be unfathomable to maintain a system of this scale through a centrally
governed switchboard service like an ESB.
</p>
        <p>
Well, where does that leave “ESB technologies” like BizTalk Server? The answer is
simply that they’re being used for what they’re commonly used for in practice. As
a gateway technology. Once a service in such a federation would have to adhere to
a particular industry standard for commerce, for instance if it would have to understand
EDIFACT or X.12 messages sent to it, the Gateway would employ an appropriate and proven
implementation and thus likely rely on BizTalk if implemented on the Microsoft stack.
If a service would have to speak to an external service for which it would have to
build EDI exchanges, it would likely be very cost effective to also use BizTalk as
the appropriate tool for that outbound integration. Likewise, if data would have to
be extracted from backend-internal message traffic for tracking purposes and BizTalk’s
BAM capabilities would be a fit, it might be a reasonable component to use for that.
If there’s a long running process around exchanging electronic documents, BizTalk
Orchestration might be appropriate, if there’s a document exchange involving humans
then SharePoint and/or Workflow would be a good candidate from the toolset. 
</p>
        <p>
For most services, the key gateway technology of choice is HTTP using frameworks like
ASP.NET, Web API, probably paired with IIS features like application request routing
and the gateway is largely stateless.
</p>
        <p>
In this context, <em>Windows Azure Service Bus</em> is, in fact, a technology choice
to implement application gateways. A Service Bus namespace thus forms a message bus
for “a service” and not for “all services”. It’s as scoped to a service or a set of
related services as an IIS site is usually scoped to one or a few related services.
The Relay is a way to place a gateway into the cloud for services where the backend
resides outside of the cloud environment and it also allows for multiple systems,
e.g. branch systems, to be federated into a single gateway to be addressed from other
systems and thus form a gateway of gateways. The messaging capabilities with Queues
and Pub/Sub Topics provide a way for inbound traffic to be authorized and queued up
on behalf of the service, with Service Bus acting as the mediator and first line of
defense and where a service will never get a message from the outside world unless
it explicitly fetches it from Service Bus. The service can’t be overstressed and it
can’t be accessed except through sending it a message. 
</p>
        <p>
The next logical step on that journey is to provide federation capabilities with reliable
handoff of message between services, meaning that you can safely enqueue a message
within a service and then have Service Bus replicate that message (or one copy in
the case of pub/sub) over to another service’s Gateway – across namespaces and across
datacenters or your own sites, and using the open AMQP protocol. You can do that today
with a few lines of code, but this will become inherent to the system later this year. 
</p>
        <img width="0" height="0" src="http://vasters.com/clemensv/aggbug.ashx?id=4718bf97-cc2e-46ba-854a-f4a1d93fb2a9" />
      </body>
      <title>Utopia ESB</title>
      <guid isPermaLink="false">http://vasters.com/clemensv/PermaLink,guid,4718bf97-cc2e-46ba-854a-f4a1d93fb2a9.aspx</guid>
      <link>http://vasters.com/clemensv/2013/01/15/Utopia+ESB.aspx</link>
      <pubDate>Tue, 15 Jan 2013 18:56:36 GMT</pubDate>
      <description>&lt;p&gt;
&lt;a href="http://en.wikipedia.org/wiki/File:ESB.png"&gt;&lt;img style="BORDER-LEFT-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px; BACKGROUND-IMAGE: none; BORDER-BOTTOM-WIDTH: 0px; FLOAT: right; PADDING-TOP: 0px; PADDING-LEFT: 0px; MARGIN: 2px 0px 2px 5px; DISPLAY: inline; PADDING-RIGHT: 0px; BORDER-TOP-WIDTH: 0px" border=0 alt=File:ESB.png align=right src="http://upload.wikimedia.org/wikipedia/commons/thumb/8/80/ESB.png/751px-ESB.png" width=300 height=240&gt;&lt;/a&gt;The
basic idea of the Enterprise Service Bus paints a wonderful picture of a harmonious
coexistence, integration, and collaboration of software services. Services for a particular
general cause are built or procured once and reused across the Enterprise by ways
of publishing them and their capabilities in a corporate services repository from
where they can be discovered. The repository holds contracts and policy that allows
dynamically generating functional adapters to integrate with services. Collaboration
and communication is virtualized through an intermediary layer that knows how to translate
messages from and to any other service hooked into the ESB like a babel fish in the
Hitchhiker’s Guide to the Galaxy. The ESB is a bus, meaning it aspires to be a smart,
virtualizing, mediating, orchestrating messaging substrate permeating the Enterprise,
providing uniform and mediated access anytime and anywhere throughout today’s global
Enterprise. That idea is so beautiful, it rivals My Little Pony. Sadly, it’s also
about as realistic. We tried regardless.
&lt;/p&gt;
&lt;p&gt;
As with many utopian ideas, before we can get to the pure ideal of an ESB, there’s
some less ideal and usually fairly ugly phase involved where non-conformant services
are made conformant. Until they are turned into WS-* services, any CICS transaction
and SAP BAPI is fronted with a translator and as that skinning renovation takes place,
there’s also some optimization around message flow, meaning messages get batched or
de-batched, enriched or reduced. In that phase, there was also learning of the value
and lure of the benefits of central control. SOA Governance is an interesting idea
to get customers drunk on. That ultimately led to cheating on the ‘B’. When you look
around and look at products proudly carrying the moniker ‘Enterprise Service Bus’
you will see hubs. In practice, the B in ESB is mostly just a lie. Some vendors sell
ESB servers, some even sell ESB appliances. If you need to walk to a central place
to talk to anyone, it’s a hub. Not a bus. 
&lt;/p&gt;
&lt;p&gt;
Yet, the bus does exist. The IP network is the bus. It turns out to suit us well on
the Internet. Mind that I’m explicitly talking about “IP network” and not “Web” as
I do believe that there are very many useful protocols beyond HTTP. The Web is obviously
the banner example for a successful implementation of services on the IP network that
does just fine without any form of centralized services other than the highly redundant
domain name system. 
&lt;/p&gt;
&lt;p&gt;
Centralized control over services does not scale in any dimension. Intentionally creating
a bottleneck through a centrally controlling committee of ESB machines, however far
scaled out, is not a winning proposition in a time where every potential or actual
customer carries a powerful computer in their pockets allowing to initiate ad-hoc
transactions at any time and from anywhere and where we see vehicles, machines and
devices increasingly spew out telemetry and accept remote control commands. Central
control and policy driven governance over all services in an Enterprise also kills
all agility and reduces the ability to adapt services to changing needs because governance
invariably implies process and certification. Five-year plan, anyone? 
&lt;/p&gt;
&lt;p&gt;
If the ESB architecture ideal weren’t a failure already, the competitive pressure
to adopt direct digital interaction with customers via Web and Apps, and therefore
scale up not to the scale of the enterprise, but to scale up to the scale of the enterprise’s
customer base will seal its collapse. 
&lt;/p&gt;
&lt;h3&gt;Service Orientation
&lt;/h3&gt;
&lt;p&gt;
While the ESB as a concept permeating the entire Enterprise is dead, the related notion
of Service Orientation is thriving even though the &lt;a href="http://msdn.microsoft.com/en-us/library/ff648318.aspx#SOATenets"&gt;four
tenets of SOA&lt;/a&gt; are rarely mentioned anymore. HTTP-based services on the Web embrace
explicit message passing. They mostly do so over the baseline application contract
and negotiated payloads that the HTTP specification provides for. In the case of SOAP
or XML-RPC, they are using abstractions on top that have their own application protocol
semantics. Services are clearly understood as units of management, deployment, and
versioning and that understanding is codified in most platform-as-a-service offerings. 
&lt;/p&gt;
&lt;p&gt;
That said, while explicit boundaries, autonomy, and contract sharing have been clearly
established, the notion of policy-driven compatibility – arguably a political addition
to the list to motivate WS-Policy as the time – has generally been replaced by something
even more powerful: Code. JavaScript code to be more precise. Instead of trying to
tell a generic client how to adapt to service settings by ways of giving it a complex
document explaining what switches to turn, clients now get code that turns the switches
outright. The successful alternative is to simply provide no choice. There’s one way
to gain access authorization for a service, period. The “policy” is in the docs. 
&lt;/p&gt;
&lt;p&gt;
The REST architecture model is service oriented – and I am not meaning to imply that
it is so because of any particular influence. The foundational principles were becoming
common sense around the time when these terms were coined and as the notion of broadly
interoperable programmable services started to gain traction in the late 1990s – the
subsequent grand dissent that arose was around whether pure HTTP was sufficient to
build these services, or whether the ambitious multi-protocol abstraction for WS-*
would be needed. I think it’s fairly easy to declare the winner there. 
&lt;/p&gt;
&lt;h3&gt;Federated Autonomous Services
&lt;/h3&gt;
&lt;p&gt;
&lt;a href="http://vasters.com/clemensv/content/binary/Windows-Live-Writer/Utopia-ESB_87DD/image_2.png"&gt;&lt;img title=image style="BORDER-LEFT-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px; BACKGROUND-IMAGE: none; BORDER-BOTTOM-WIDTH: 0px; FLOAT: right; PADDING-TOP: 0px; PADDING-LEFT: 0px; DISPLAY: inline; PADDING-RIGHT: 0px; BORDER-TOP-WIDTH: 0px" border=0 alt=image align=right src="http://vasters.com/clemensv/content/binary/Windows-Live-Writer/Utopia-ESB_87DD/image_thumb.png" width=240 height=213&gt;&lt;/a&gt;Windows
Azure, to name a system that would surely be one to fit the kind of solution complexity
that ESBs were aimed at, is a very large distributed system with a significant number
of independent multi-tenant services and deployments that are spread across many data
centers. In addition to the publicly exposed capabilities, there are quite a number
of “invisible” services for provisioning, usage tracking and analysis, billing, diagnostics,
deployment, and other purposes.&amp;nbsp; Some components of these internal services integrate
with external providers. Windows Azure doesn’t use an ESB. Windows Azure is a federation
of autonomous services.
&lt;/p&gt;
&lt;p&gt;
The basic shape of each of these services is effectively identical and that’s not
owing, at least not to my knowledge, to any central architectural directive even though
the services that shipped after the initial wave certainly took a good look at the
patterns that emerged. Practically all services have a gateway whose purpose it is
to handle and dispatch and sometimes preprocess incoming network requests or sessions
and a backend that ultimately fulfills the requests. The services interact through
public IP space, meaning that if Service Bus wants to talk to its SQL Database backend
it is using a public IP address and not some private IP. The Internet is the bus.
The backend and its structure is entirely a private implementation matter.&amp;nbsp; It
could be a single role or many roles. 
&lt;/p&gt;
&lt;p&gt;
Any gateway’s job is to provide network request management, which includes establishing
and maintaining sessions, session security and authorization, API versioning where
multiple variants of the same API are often provided in parallel, usage tracking,
defense mechanisms, and diagnostics for its areas of responsibility. This functionality
is specific and inherent to the service. And it’s not all HTTP. SQL database has a
gateway that speaks the Tabular Data Stream protocol (TDS) over TCP, for instance,
and Service Bus has a gateway that speaks AMQP and the binary proprietary Relay and
Messaging protocols.
&lt;/p&gt;
&lt;p&gt;
Governance and diagnostics doesn’t work by putting a man in the middle and watching
the traffic coming by, which is akin to trying the tell whether a business is healthy
by counting the trucks going to their warehouse. Instead we are integrating the data
feeds that come out of the respective services and are generated fully knowing the
internal state, and concentrate these data streams, like the billing stream, in yet
other services that are also autonomous and have their own gateways. All these services
interact and integrate even though they’re built by a composite team far exceeding
the scale of most Enterprise’s largest projects, and while teams run on separate schedules
where deployments into the overall system happen multiple times daily. It works because
each service owns its gateway, is explicit about its versioning strategy, and has
a very clear mandate to honor published contracts, which includes explicit regression
testing. It would be unfathomable to maintain a system of this scale through a centrally
governed switchboard service like an ESB.
&lt;/p&gt;
&lt;p&gt;
Well, where does that leave “ESB technologies” like BizTalk Server? The answer is
simply that they’re being used for what they’re commonly used for in practice. As
a gateway technology. Once a service in such a federation would have to adhere to
a particular industry standard for commerce, for instance if it would have to understand
EDIFACT or X.12 messages sent to it, the Gateway would employ an appropriate and proven
implementation and thus likely rely on BizTalk if implemented on the Microsoft stack.
If a service would have to speak to an external service for which it would have to
build EDI exchanges, it would likely be very cost effective to also use BizTalk as
the appropriate tool for that outbound integration. Likewise, if data would have to
be extracted from backend-internal message traffic for tracking purposes and BizTalk’s
BAM capabilities would be a fit, it might be a reasonable component to use for that.
If there’s a long running process around exchanging electronic documents, BizTalk
Orchestration might be appropriate, if there’s a document exchange involving humans
then SharePoint and/or Workflow would be a good candidate from the toolset. 
&lt;/p&gt;
&lt;p&gt;
For most services, the key gateway technology of choice is HTTP using frameworks like
ASP.NET, Web API, probably paired with IIS features like application request routing
and the gateway is largely stateless.
&lt;/p&gt;
&lt;p&gt;
In this context, &lt;em&gt;Windows Azure Service Bus&lt;/em&gt; is, in fact, a technology choice
to implement application gateways. A Service Bus namespace thus forms a message bus
for “a service” and not for “all services”. It’s as scoped to a service or a set of
related services as an IIS site is usually scoped to one or a few related services.
The Relay is a way to place a gateway into the cloud for services where the backend
resides outside of the cloud environment and it also allows for multiple systems,
e.g. branch systems, to be federated into a single gateway to be addressed from other
systems and thus form a gateway of gateways. The messaging capabilities with Queues
and Pub/Sub Topics provide a way for inbound traffic to be authorized and queued up
on behalf of the service, with Service Bus acting as the mediator and first line of
defense and where a service will never get a message from the outside world unless
it explicitly fetches it from Service Bus. The service can’t be overstressed and it
can’t be accessed except through sending it a message. 
&lt;/p&gt;
&lt;p&gt;
The next logical step on that journey is to provide federation capabilities with reliable
handoff of message between services, meaning that you can safely enqueue a message
within a service and then have Service Bus replicate that message (or one copy in
the case of pub/sub) over to another service’s Gateway – across namespaces and across
datacenters or your own sites, and using the open AMQP protocol. You can do that today
with a few lines of code, but this will become inherent to the system later this year. 
&lt;/p&gt;
&lt;img width="0" height="0" src="http://vasters.com/clemensv/aggbug.ashx?id=4718bf97-cc2e-46ba-854a-f4a1d93fb2a9" /&gt;</description>
      <comments>http://vasters.com/clemensv/CommentView,guid,4718bf97-cc2e-46ba-854a-f4a1d93fb2a9.aspx</comments>
      <category>Architecture</category>
      <category>Architecture/SOA</category>
      <category>Azure</category>
    </item>
    <item>
      <trackback:ping>http://vasters.com/clemensv/Trackback.aspx?guid=d69897ff-32eb-4e44-9fea-0ee67005da75</trackback:ping>
      <pingback:server>http://vasters.com/clemensv/pingback.aspx</pingback:server>
      <pingback:target>http://vasters.com/clemensv/PermaLink,guid,d69897ff-32eb-4e44-9fea-0ee67005da75.aspx</pingback:target>
      <dc:creator>
      </dc:creator>
      <wfw:comment>http://vasters.com/clemensv/CommentView,guid,d69897ff-32eb-4e44-9fea-0ee67005da75.aspx</wfw:comment>
      <wfw:commentRss>http://vasters.com/clemensv/SyndicationService.asmx/GetEntryCommentsRss?guid=d69897ff-32eb-4e44-9fea-0ee67005da75</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Head over to my Subscribe! blog on Channel 9 for the <a href="http://channel9.msdn.com/Blogs/Subscribe/Negotiate-Promise-Do-Transactions" target="_blank">latest
episode on Transactions</a>.
</p>
        <img width="0" height="0" src="http://vasters.com/clemensv/aggbug.ashx?id=d69897ff-32eb-4e44-9fea-0ee67005da75" />
      </body>
      <title>Negotiate, Promise, Do. Transactions.</title>
      <guid isPermaLink="false">http://vasters.com/clemensv/PermaLink,guid,d69897ff-32eb-4e44-9fea-0ee67005da75.aspx</guid>
      <link>http://vasters.com/clemensv/2013/01/10/Negotiate+Promise+Do+Transactions.aspx</link>
      <pubDate>Thu, 10 Jan 2013 00:16:42 GMT</pubDate>
      <description>&lt;p&gt;
Head over to my Subscribe! blog on Channel 9 for the &lt;a href="http://channel9.msdn.com/Blogs/Subscribe/Negotiate-Promise-Do-Transactions" target=_blank&gt;latest
episode on Transactions&lt;/a&gt;.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://vasters.com/clemensv/aggbug.ashx?id=d69897ff-32eb-4e44-9fea-0ee67005da75" /&gt;</description>
      <comments>http://vasters.com/clemensv/CommentView,guid,d69897ff-32eb-4e44-9fea-0ee67005da75.aspx</comments>
    </item>
    <item>
      <trackback:ping>http://vasters.com/clemensv/Trackback.aspx?guid=fcc97fd0-5035-4147-b323-5e2e8ead54a8</trackback:ping>
      <pingback:server>http://vasters.com/clemensv/pingback.aspx</pingback:server>
      <pingback:target>http://vasters.com/clemensv/PermaLink,guid,fcc97fd0-5035-4147-b323-5e2e8ead54a8.aspx</pingback:target>
      <dc:creator>
      </dc:creator>
      <wfw:comment>http://vasters.com/clemensv/CommentView,guid,fcc97fd0-5035-4147-b323-5e2e8ead54a8.aspx</wfw:comment>
      <wfw:commentRss>http://vasters.com/clemensv/SyndicationService.asmx/GetEntryCommentsRss?guid=fcc97fd0-5035-4147-b323-5e2e8ead54a8</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
A suggestion <a href="http://www.mygreatwindowsazureidea.com/forums/169381-messaging-servicebus/suggestions/3389608-support-distributed-transactions?utm_campaign=shorturls&amp;utm_source=www.mygreatwindowsazureidea.com">was
made on mygreatwindowsazureidea.com</a> for Windows Azure Service Bus to support distributed
transactions. The item isn’t very popular on the site with 7 votes, but I know that
that’s a topic near and dear to the heart of many folks writing business solutions.
We in the Service Bus team owning MSMQ and the Workflow team next door owns DTC and
we’re getting enough requests now that we’ll start working on better guidance around
transactions in the coming months, some of which will come in form of clips on my <a href="http://channel9.msdn.com/blogs/subscribe">Subscribe
blog on Channel 9</a>. 
</p>
        <p>
What’s not likely going to happen is that we will provide a magic “it just works”
solution that brings DTC and the 2PC model to the cloud. Why? Because 2PC isn’t doing
well in that world. Here is my reply to the post on mygreatwindowsazureidea.com for
better linking:
</p>
        <div style="margin-left: 20px">
          <p>
            <em>Hi, I'm on the Service Bus team and I very much appreciate the intent of this
suggestion. </em>
          </p>
          <p>
            <em>I wish we could enable that easily, but unfortunately this is a hard problem. </em>
          </p>
          <p>
            <em>The distributed transaction model with the common 2-phase-commit protocol with
a central coordinator is very suitable as a convenient error management mechanism
for physical single-node systems and for small clusters of a few physical nodes that
are close together. As you get very serious about scale, virtualization and high availability,
the very foundation of that model starts shaking. </em>
          </p>
          <p>
            <em>For 2PC to work, the coordinator’s availability both in terms of compute but also
in terms of network availability must be close to perfect. If you lose the coordinator
or you lose sight of the coordinator and you have resources in ‘prepared’ state, there
is no reasonable mechanism for those resources to break their promise and back out
in 2PC. On premises, the solution to that is to cluster DTC with the Windows Clustering
services on a shared, redundant disk array and have redundant networking to all resources.
Unless you do exactly that, you’re not likely building a solution that survives a
DTC hardware component failure without running in major trouble on the software side.
Once you step into virtualized environments, a lot of the underlying assumptions of
that cluster setup start to break down as the virtualization environment and placement
strategies introduce new risk into the relationship between the clustered resources. </em>
          </p>
          <p>
            <em>Likewise, the resource managers themselves are moved further away. You no longer
have a tightly controlled system where everything runs in a rack and is on the same
network segment with negligible latency. Things run scattered over many racks. The
bias in virtualization environments and the cloud is system availability (i.e. the
majority of nodes in a system is available) and not single-node reliability (i.e.
nodes don't go down). </em>
          </p>
          <p>
            <em>The 2PC model largely assumes that individual transactions go wrong due to intermittent
issues and not due to losing random nodes completely and without notice. It obviously
does provide a lifeline for when resource managers run into serious system issues
as transactions are in progress, but it’s generally not very suitable for a world
where workloads span many nodes and stuff goes up and down and moves all the time
for the sake of overall system availability when that also includes the coordinator. </em>
          </p>
          <p>
            <em>The result of using distributed transactions spanning multiple nodes in such an
environment is, at worst and as explained by the CAP theorem, a complete gridlock
as locks get placed and held and either take very long to resolve or end up leaving
transactions in doubt requiring intervention. </em>
          </p>
          <p>
            <em>Ultimately, MSDTC is a single-node/cluster and local-network technology, which
also manifests in its security model that is fairly difficult to adapt to a multitenant
cloud system. </em>
          </p>
          <p>
            <em>Mind that I am by no means looking to cast any doubts over anyone's use of MSDTC
within its design scope. MSDTC is proven and rock-solid reliable within those limits.
When all resources are on one node or are close together, belong to a single tenant/app,
and within a trust domain, it is and remains a great choice, because of the simplicity
it provides around failure management, even for work spanning multiple resources inside
a Windows Azure VM. </em>
          </p>
          <p>
            <em>Due to these considerations, it's hard for us to support classic distributed transactions
with DTC enlistment because people would justifiably expect them to "just work"
- and it's hard to see how they would. Beyond that, I have serious concerns around
system availability and security if locks on Service Bus' internal resources could
be impacted by third parties by ways of having them enlisted in a transaction even
if we were owning the coordinator. </em>
          </p>
          <p>
            <em>That all said, we do have DTC support for MSMQ, which is also owned by the Service
Bus team. The way to get DTC support for Service Bus is to proxy it with a local MSMQ
queue and then do a reliable handoff to Service Bus with a pump. We already have a
sample for that and we will framework that further:</em>
          </p>
          <p>
            <a href="http://code.msdn.microsoft.com/windowsazure/Service-Bus-Durable-Sender-0763230d">
              <em>http://code.msdn.microsoft.com/windowsazure/Service-Bus-Durable-Sender-0763230d</em>
            </a>
          </p>
          <p>
            <em>The considerations for Service Bus for Windows Server are similar.</em>
          </p>
        </div>
        <img width="0" height="0" src="http://vasters.com/clemensv/aggbug.ashx?id=fcc97fd0-5035-4147-b323-5e2e8ead54a8" />
      </body>
      <title>Distributed Transactions and Virtualization</title>
      <guid isPermaLink="false">http://vasters.com/clemensv/PermaLink,guid,fcc97fd0-5035-4147-b323-5e2e8ead54a8.aspx</guid>
      <link>http://vasters.com/clemensv/2013/01/02/Distributed+Transactions+And+Virtualization.aspx</link>
      <pubDate>Wed, 02 Jan 2013 16:14:55 GMT</pubDate>
      <description>&lt;p&gt;
A suggestion &lt;a href="http://www.mygreatwindowsazureidea.com/forums/169381-messaging-servicebus/suggestions/3389608-support-distributed-transactions?utm_campaign=shorturls&amp;amp;utm_source=www.mygreatwindowsazureidea.com"&gt;was
made on mygreatwindowsazureidea.com&lt;/a&gt; for Windows Azure Service Bus to support distributed
transactions. The item isn’t very popular on the site with 7 votes, but I know that
that’s a topic near and dear to the heart of many folks writing business solutions.
We in the Service Bus team owning MSMQ and the Workflow team next door owns DTC and
we’re getting enough requests now that we’ll start working on better guidance around
transactions in the coming months, some of which will come in form of clips on my &lt;a href="http://channel9.msdn.com/blogs/subscribe"&gt;Subscribe
blog on Channel 9&lt;/a&gt;. 
&lt;/p&gt;
&lt;p&gt;
What’s not likely going to happen is that we will provide a magic “it just works”
solution that brings DTC and the 2PC model to the cloud. Why? Because 2PC isn’t doing
well in that world. Here is my reply to the post on mygreatwindowsazureidea.com for
better linking:
&lt;/p&gt;
&lt;div style="margin-left: 20px"&gt;
&lt;p&gt;
&lt;em&gt;Hi, I'm on the Service Bus team and I very much appreciate the intent of this
suggestion. &lt;/em&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;em&gt;I wish we could enable that easily, but unfortunately this is a hard problem. &lt;/em&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;em&gt;The distributed transaction model with the common 2-phase-commit protocol with
a central coordinator is very suitable as a convenient error management mechanism
for physical single-node systems and for small clusters of a few physical nodes that
are close together. As you get very serious about scale, virtualization and high availability,
the very foundation of that model starts shaking. &lt;/em&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;em&gt;For 2PC to work, the coordinator’s availability both in terms of compute but also
in terms of network availability must be close to perfect. If you lose the coordinator
or you lose sight of the coordinator and you have resources in ‘prepared’ state, there
is no reasonable mechanism for those resources to break their promise and back out
in 2PC. On premises, the solution to that is to cluster DTC with the Windows Clustering
services on a shared, redundant disk array and have redundant networking to all resources.
Unless you do exactly that, you’re not likely building a solution that survives a
DTC hardware component failure without running in major trouble on the software side.
Once you step into virtualized environments, a lot of the underlying assumptions of
that cluster setup start to break down as the virtualization environment and placement
strategies introduce new risk into the relationship between the clustered resources. &lt;/em&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;em&gt;Likewise, the resource managers themselves are moved further away. You no longer
have a tightly controlled system where everything runs in a rack and is on the same
network segment with negligible latency. Things run scattered over many racks. The
bias in virtualization environments and the cloud is system availability (i.e. the
majority of nodes in a system is available) and not single-node reliability (i.e.
nodes don't go down). &lt;/em&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;em&gt;The 2PC model largely assumes that individual transactions go wrong due to intermittent
issues and not due to losing random nodes completely and without notice. It obviously
does provide a lifeline for when resource managers run into serious system issues
as transactions are in progress, but it’s generally not very suitable for a world
where workloads span many nodes and stuff goes up and down and moves all the time
for the sake of overall system availability when that also includes the coordinator. &lt;/em&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;em&gt;The result of using distributed transactions spanning multiple nodes in such an
environment is, at worst and as explained by the CAP theorem, a complete gridlock
as locks get placed and held and either take very long to resolve or end up leaving
transactions in doubt requiring intervention. &lt;/em&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;em&gt;Ultimately, MSDTC is a single-node/cluster and local-network technology, which
also manifests in its security model that is fairly difficult to adapt to a multitenant
cloud system. &lt;/em&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;em&gt;Mind that I am by no means looking to cast any doubts over anyone's use of MSDTC
within its design scope. MSDTC is proven and rock-solid reliable within those limits.
When all resources are on one node or are close together, belong to a single tenant/app,
and within a trust domain, it is and remains a great choice, because of the simplicity
it provides around failure management, even for work spanning multiple resources inside
a Windows Azure VM. &lt;/em&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;em&gt;Due to these considerations, it's hard for us to support classic distributed transactions
with DTC enlistment because people would justifiably expect them to &amp;quot;just work&amp;quot;
- and it's hard to see how they would. Beyond that, I have serious concerns around
system availability and security if locks on Service Bus' internal resources could
be impacted by third parties by ways of having them enlisted in a transaction even
if we were owning the coordinator. &lt;/em&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;em&gt;That all said, we do have DTC support for MSMQ, which is also owned by the Service
Bus team. The way to get DTC support for Service Bus is to proxy it with a local MSMQ
queue and then do a reliable handoff to Service Bus with a pump. We already have a
sample for that and we will framework that further:&lt;/em&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://code.msdn.microsoft.com/windowsazure/Service-Bus-Durable-Sender-0763230d"&gt;&lt;em&gt;http://code.msdn.microsoft.com/windowsazure/Service-Bus-Durable-Sender-0763230d&lt;/em&gt;&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;em&gt;The considerations for Service Bus for Windows Server are similar.&lt;/em&gt;
&lt;/p&gt;
&lt;/div&gt;
&lt;img width="0" height="0" src="http://vasters.com/clemensv/aggbug.ashx?id=fcc97fd0-5035-4147-b323-5e2e8ead54a8" /&gt;</description>
      <comments>http://vasters.com/clemensv/CommentView,guid,fcc97fd0-5035-4147-b323-5e2e8ead54a8.aspx</comments>
    </item>
    <item>
      <trackback:ping>http://vasters.com/clemensv/Trackback.aspx?guid=7d715945-1966-4672-bcd0-ad5fa7977cb0</trackback:ping>
      <pingback:server>http://vasters.com/clemensv/pingback.aspx</pingback:server>
      <pingback:target>http://vasters.com/clemensv/PermaLink,guid,7d715945-1966-4672-bcd0-ad5fa7977cb0.aspx</pingback:target>
      <dc:creator>
      </dc:creator>
      <wfw:comment>http://vasters.com/clemensv/CommentView,guid,7d715945-1966-4672-bcd0-ad5fa7977cb0.aspx</wfw:comment>
      <wfw:commentRss>http://vasters.com/clemensv/SyndicationService.asmx/GetEntryCommentsRss?guid=7d715945-1966-4672-bcd0-ad5fa7977cb0</wfw:commentRss>
      <slash:comments>1</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Here’s <a href="http://channel9.msdn.com/Blogs/Subscribe/Push-vs-Pull">from my Channel
9 Subscribe</a> blog, an ad-hoc, single-take whiteboard discussion on "push" and "pull"
communication patterns. There's a lot of talk in the industry on push (see push notifications)
and pulling/polling (long polling vs. web sockets and messaging), so I'm dissecting
that space a bit and explore push vs. pull and various pattern nuances from UDP upwards. 
</p>
        <p>
          <iframe style="HEIGHT: 288px; WIDTH: 512px" src="http://channel9.msdn.com/Blogs/Subscribe/Push-vs-Pull/player?w=512&amp;h=288" frameborder="0" scrolling="no" align="center">
          </iframe>
        </p>
        <img width="0" height="0" src="http://vasters.com/clemensv/aggbug.ashx?id=7d715945-1966-4672-bcd0-ad5fa7977cb0" />
      </body>
      <title>Push vs. Pull</title>
      <guid isPermaLink="false">http://vasters.com/clemensv/PermaLink,guid,7d715945-1966-4672-bcd0-ad5fa7977cb0.aspx</guid>
      <link>http://vasters.com/clemensv/2012/12/08/Push+Vs+Pull.aspx</link>
      <pubDate>Sat, 08 Dec 2012 12:35:13 GMT</pubDate>
      <description>&lt;p&gt;
Here’s &lt;a href="http://channel9.msdn.com/Blogs/Subscribe/Push-vs-Pull"&gt;from my Channel
9 Subscribe&lt;/a&gt; blog, an ad-hoc, single-take whiteboard discussion on "push" and "pull"
communication patterns. There's a lot of talk in the industry on push (see push notifications)
and pulling/polling (long polling vs. web sockets and messaging), so I'm dissecting
that space a bit and explore push vs. pull and various pattern nuances from UDP upwards. 
&lt;/p&gt;
&lt;p&gt;
&lt;iframe style="HEIGHT: 288px; WIDTH: 512px" src="http://channel9.msdn.com/Blogs/Subscribe/Push-vs-Pull/player?w=512&amp;amp;h=288" frameborder=0 scrolling=no align=center&gt;
&lt;/iframe&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://vasters.com/clemensv/aggbug.ashx?id=7d715945-1966-4672-bcd0-ad5fa7977cb0" /&gt;</description>
      <comments>http://vasters.com/clemensv/CommentView,guid,7d715945-1966-4672-bcd0-ad5fa7977cb0.aspx</comments>
    </item>
    <item>
      <trackback:ping>http://vasters.com/clemensv/Trackback.aspx?guid=4541fd70-3771-44ae-975f-65c22ba05756</trackback:ping>
      <pingback:server>http://vasters.com/clemensv/pingback.aspx</pingback:server>
      <pingback:target>http://vasters.com/clemensv/PermaLink,guid,4541fd70-3771-44ae-975f-65c22ba05756.aspx</pingback:target>
      <dc:creator>
      </dc:creator>
      <wfw:comment>http://vasters.com/clemensv/CommentView,guid,4541fd70-3771-44ae-975f-65c22ba05756.aspx</wfw:comment>
      <wfw:commentRss>http://vasters.com/clemensv/SyndicationService.asmx/GetEntryCommentsRss?guid=4541fd70-3771-44ae-975f-65c22ba05756</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Over on my new Channel 9 blog I've started a series that will (hopefully) help novices
with getting started developing applications that leverage Windows Azure Service Bus
(and, in coming episodes also Service Bus for Windows Server)
</p>
        <p>
The first two episodes are up:
</p>
        <ul>
          <li>
            <a href="http://channel9.msdn.com/Blogs/Subscribe/Getting-Started-with-Service-Bus-Part-1-The-Portal">Getting
Started with Service Bus. Part 1: The Portal</a>
          </li>
          <li>
            <a href="http://channel9.msdn.com/Blogs/Subscribe/Getting-Started-with-Service-Bus-Part-2-NET-SDK-and-Visual-Studio">Getting
Started with Service Bus. Part 2: .NET SDK and Visual Studio</a> </li>
        </ul>
        <p>
There's much more to come, and the best way to get at it as it comes out is to subscribe
to the <a href="http://channel9.msdn.com/Blogs/Subscribe/RSS">RSS feed</a> or <a href="http://channel9.msdn.com/Blogs/Subscribe">bookmark
the landing page</a>.
</p>
        <img width="0" height="0" src="http://vasters.com/clemensv/aggbug.ashx?id=4541fd70-3771-44ae-975f-65c22ba05756" />
      </body>
      <title>Subscribe! - Getting Started with Service Bus</title>
      <guid isPermaLink="false">http://vasters.com/clemensv/PermaLink,guid,4541fd70-3771-44ae-975f-65c22ba05756.aspx</guid>
      <link>http://vasters.com/clemensv/2012/12/05/Subscribe+Getting+Started+With+Service+Bus.aspx</link>
      <pubDate>Wed, 05 Dec 2012 15:12:19 GMT</pubDate>
      <description>&lt;p&gt;
Over on my new Channel 9 blog I've started a series that will (hopefully) help novices
with getting started developing applications that leverage Windows Azure Service Bus
(and, in coming episodes also&amp;nbsp;Service Bus for Windows Server)
&lt;/p&gt;
&lt;p&gt;
The first two episodes are up:
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;a href="http://channel9.msdn.com/Blogs/Subscribe/Getting-Started-with-Service-Bus-Part-1-The-Portal"&gt;Getting
Started with Service Bus. Part 1: The&amp;nbsp;Portal&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="http://channel9.msdn.com/Blogs/Subscribe/Getting-Started-with-Service-Bus-Part-2-NET-SDK-and-Visual-Studio"&gt;Getting
Started with Service Bus. Part 2: .NET SDK and Visual&amp;nbsp;Studio&lt;/a&gt;&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
There's much more to come, and the best way to get at it as it comes out is to subscribe
to the &lt;a href="http://channel9.msdn.com/Blogs/Subscribe/RSS"&gt;RSS feed&lt;/a&gt; or &lt;a href="http://channel9.msdn.com/Blogs/Subscribe"&gt;bookmark
the landing page&lt;/a&gt;.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://vasters.com/clemensv/aggbug.ashx?id=4541fd70-3771-44ae-975f-65c22ba05756" /&gt;</description>
      <comments>http://vasters.com/clemensv/CommentView,guid,4541fd70-3771-44ae-975f-65c22ba05756.aspx</comments>
      <category>Architecture</category>
    </item>
    <item>
      <trackback:ping>http://vasters.com/clemensv/Trackback.aspx?guid=8c63031d-2ac6-4dc2-be91-253e55c6d6e9</trackback:ping>
      <pingback:server>http://vasters.com/clemensv/pingback.aspx</pingback:server>
      <pingback:target>http://vasters.com/clemensv/PermaLink,guid,8c63031d-2ac6-4dc2-be91-253e55c6d6e9.aspx</pingback:target>
      <dc:creator>
      </dc:creator>
      <wfw:comment>http://vasters.com/clemensv/CommentView,guid,8c63031d-2ac6-4dc2-be91-253e55c6d6e9.aspx</wfw:comment>
      <wfw:commentRss>http://vasters.com/clemensv/SyndicationService.asmx/GetEntryCommentsRss?guid=8c63031d-2ac6-4dc2-be91-253e55c6d6e9</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I have a new (additional) blog. It's not a "write" blog, it's a "speak" blog. Over
on Microsoft's Channel 9 I started the "Subscribe!" blog last Friday night. 
</p>
        <p>
The goal for it is to be a way to talk about middleware and specifically about my
team's product Service Bus on Channel 9. Service Bus and the other middleware products
and features tend to require quite a bit of guidance and explanation because they
help solving complex problems. I'm trying to help providing a forum for that, not
only in the form of monologues, but also having our customers and my coworkers speak. 
</p>
        <p>
Here's the link <a href="http://channel9.msdn.com/blogs/subscribe/">http://channel9.msdn.com/blogs/subscribe/</a></p>
        <img width="0" height="0" src="http://vasters.com/clemensv/aggbug.ashx?id=8c63031d-2ac6-4dc2-be91-253e55c6d6e9" />
      </body>
      <title>“Subscribe!”</title>
      <guid isPermaLink="false">http://vasters.com/clemensv/PermaLink,guid,8c63031d-2ac6-4dc2-be91-253e55c6d6e9.aspx</guid>
      <link>http://vasters.com/clemensv/2012/12/04/Subscribe.aspx</link>
      <pubDate>Tue, 04 Dec 2012 19:52:14 GMT</pubDate>
      <description>&lt;p&gt;
I have a new (additional) blog. It's not a "write" blog, it's a "speak" blog. Over
on Microsoft's Channel 9 I started the "Subscribe!" blog last Friday night. 
&lt;/p&gt;
&lt;p&gt;
The goal for it is to be a way to talk about middleware and specifically about my
team's product Service Bus on Channel 9. Service Bus and the other middleware products
and features tend to require quite a bit of guidance and explanation because they
help solving complex problems. I'm trying to help providing a forum for that, not
only in the form of monologues, but also having our customers and my coworkers speak. 
&lt;/p&gt;
&lt;p&gt;
Here's the link &lt;a href="http://channel9.msdn.com/blogs/subscribe/"&gt;http://channel9.msdn.com/blogs/subscribe/&lt;/a&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://vasters.com/clemensv/aggbug.ashx?id=8c63031d-2ac6-4dc2-be91-253e55c6d6e9" /&gt;</description>
      <comments>http://vasters.com/clemensv/CommentView,guid,8c63031d-2ac6-4dc2-be91-253e55c6d6e9.aspx</comments>
      <category>Blog</category>
    </item>
    <item>
      <trackback:ping>http://vasters.com/clemensv/Trackback.aspx?guid=c78e6d0c-dbee-4655-9944-29489df4d6f8</trackback:ping>
      <pingback:server>http://vasters.com/clemensv/pingback.aspx</pingback:server>
      <pingback:target>http://vasters.com/clemensv/PermaLink,guid,c78e6d0c-dbee-4655-9944-29489df4d6f8.aspx</pingback:target>
      <dc:creator>
      </dc:creator>
      <wfw:comment>http://vasters.com/clemensv/CommentView,guid,c78e6d0c-dbee-4655-9944-29489df4d6f8.aspx</wfw:comment>
      <wfw:commentRss>http://vasters.com/clemensv/SyndicationService.asmx/GetEntryCommentsRss?guid=c78e6d0c-dbee-4655-9944-29489df4d6f8</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Here's a short video explaining where I’m at now (<a href="http://binged.it/TfDdKV">here’s
a map</a>) and what I’m up to. Meanwhile I’ve also figured out how to put sound on
both channels with the setup that I have, but here it’s still just on the left channel
and also doesn’t sound as good as it should as I don’t have all the white-noise correcting
Jedi motions mastered.   
</p>
        <p>
Spoiler: I’ll start doing a video show on a regular basis and need input for content
planning, so if you have any ideas, don’t hesitate to <a href="mailto:clemensv@microsoft.com?subject=Video%20Show">send
me email</a> or Tweet me at @clemensv. 
</p>
        <iframe height="315" src="http://www.youtube.com/embed/tS-XwMfGlfc?rel=0" frameborder="0" width="560" allowfullscreen="allowfullscreen">
        </iframe>
        <img width="0" height="0" src="http://vasters.com/clemensv/aggbug.ashx?id=c78e6d0c-dbee-4655-9944-29489df4d6f8" />
      </body>
      <title>Where I&amp;rsquo;m at, what&amp;rsquo;s next, and asking for some help</title>
      <guid isPermaLink="false">http://vasters.com/clemensv/PermaLink,guid,c78e6d0c-dbee-4655-9944-29489df4d6f8.aspx</guid>
      <link>http://vasters.com/clemensv/2012/11/26/Where+Irsquom+At+Whatrsquos+Next+And+Asking+For+Some+Help.aspx</link>
      <pubDate>Mon, 26 Nov 2012 09:06:26 GMT</pubDate>
      <description>&lt;p&gt;
Here's a short video explaining where I’m at now (&lt;a href="http://binged.it/TfDdKV"&gt;here’s
a map&lt;/a&gt;) and what I’m up to. Meanwhile I’ve also figured out how to put sound on
both channels with the setup that I have, but here it’s still just on the left channel
and also doesn’t sound as good as it should as I don’t have all the white-noise correcting
Jedi motions mastered.&amp;nbsp;&amp;nbsp; 
&lt;/p&gt;
&lt;p&gt;
Spoiler: I’ll start doing a video show on a regular basis and need input for content
planning, so if you have any ideas, don’t hesitate to &lt;a href="mailto:clemensv@microsoft.com?subject=Video%20Show"&gt;send
me email&lt;/a&gt; or Tweet me at @clemensv. 
&lt;/p&gt;
&lt;iframe height=315 src="http://www.youtube.com/embed/tS-XwMfGlfc?rel=0" frameborder=0 width=560 allowfullscreen="allowfullscreen"&gt;
&lt;/iframe&gt;
&lt;img width="0" height="0" src="http://vasters.com/clemensv/aggbug.ashx?id=c78e6d0c-dbee-4655-9944-29489df4d6f8" /&gt;</description>
      <comments>http://vasters.com/clemensv/CommentView,guid,c78e6d0c-dbee-4655-9944-29489df4d6f8.aspx</comments>
      <category>Architecture</category>
      <category>Blog</category>
      <category>Talks</category>
    </item>
    <item>
      <trackback:ping>http://vasters.com/clemensv/Trackback.aspx?guid=abf20c1d-a3f3-4070-b54e-2a922156343a</trackback:ping>
      <pingback:server>http://vasters.com/clemensv/pingback.aspx</pingback:server>
      <pingback:target>http://vasters.com/clemensv/PermaLink,guid,abf20c1d-a3f3-4070-b54e-2a922156343a.aspx</pingback:target>
      <dc:creator>
      </dc:creator>
      <wfw:comment>http://vasters.com/clemensv/CommentView,guid,abf20c1d-a3f3-4070-b54e-2a922156343a.aspx</wfw:comment>
      <wfw:commentRss>http://vasters.com/clemensv/SyndicationService.asmx/GetEntryCommentsRss?guid=abf20c1d-a3f3-4070-b54e-2a922156343a</wfw:commentRss>
      <slash:comments>1</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I just got off the call with a customer and had a bit of a déjà vu from a meeting
at the beginning of the week, so it looks like the misconception I'll explain here
is a bit more common than I expected. 
</p>
        <p>
In both cases, the folks I talked to, had the about equivalent of the following code
in their app: 
</p>
        <p>
          <span style="FONT-FAMILY: Consolas">var qc = factory.CreateQueueClient(…);<br />
for( int i = 0; i &lt; 1000; i++ ) 
<br />
{<br />
… create message …<br />
qc.BeginSend( msg, null, null );<br />
}<br />
qc.Close(); </span>
        </p>
        <p>
In both cases, the complaint was that messages were lost and strange exceptions occurred
in the logs – which is because, well, this doesn't do what they thought it does. 
</p>
        <p>
          <em>BeginSend</em> in the Service Bus APIs or other networking APIs as much as BeginWrite
on the file system isn't really doing the work that is requested. It is putting a
job into a job queue – the job queue of the I/O thread scheduler. 
</p>
        <p>
That means that once the code reaches <em>qc.Close()</em> and you have also been mighty
lucky, a few messages may indeed have been sent, but the remaining messages will now
still sit in that job queue and scheduled for an object that the code just forced
to close. With the result that every subsequent send operation that is queued but
hasn't been scheduled yet will throw as you're trying to send on a disposed object.
Those messages will fail out and be lost inside the sender's process. 
</p>
        <p>
What's worse is that writing such code stuffs a queue that is both out of the app's
control and out of the app's sight and that all the arguments (which can be pretty
big when we talk about messages) dangle on those jobs filling up memory. Also, since
the app doesn't call <em>EndSend()</em>, the application also doesn't pick up whatever
exceptions are potentially raised by the Send operation and flies completely blind.
If there is an EndXXX method for an async operation, you _must_ call that method even
if it doesn't return any values, because it might quite well throw you back what went
wrong. 
</p>
        <p>
So how should you do it? Don't throw messages blindly into the job queue. It's ok
to queue up a few to make sure there's a job in the queue as another one completes
(which is just slightly trickier than what I want to illustrate here), but generally
you should make subsequent sends depend on previous sends completing. In .NET 4.5
with async/await that's a lot easier now: 
</p>
        <p>
          <span style="FONT-FAMILY: Consolas">var qc = factory.CreateQueueClient(…);<br />
for( int i = 0; i &lt; 1000; i++ ) 
<br />
{<br />
… create message …<br />
await task.Factory.FromAsync(qc.BeginSend, qc.EndSend, msg, null );<br />
}<br />
qc.Close(); </span>
        </p>
        <p>
Keep in mind that the primary goal of async I/O is to not waste threads and lose time
through excessive thread switching as threads hang on I/O operations. <strong><em>It's
not making the I/O magically faster per-se</em></strong>. We achieve that in the above
example as the compiler will break up that code into distinct methods where the loop
continues on an I/O thread callback once the Send operation has completed. 
</p>
        <p>
Summary: 
</p>
        <ol>
          <li>
Don't stuff the I/O scheduler queue with loads of blind calls to BeginXXX without
consideration for how the work gets done and completed and that it can actually fail 
</li>
          <li>
Always call End and think about how many operations you want to have in flight and
what happens to the objects that are attached to the in-flight jobs</li>
        </ol>
        <img width="0" height="0" src="http://vasters.com/clemensv/aggbug.ashx?id=abf20c1d-a3f3-4070-b54e-2a922156343a" />
      </body>
      <title>Service Bus: BeginSend is no magic async pixie dust</title>
      <guid isPermaLink="false">http://vasters.com/clemensv/PermaLink,guid,abf20c1d-a3f3-4070-b54e-2a922156343a.aspx</guid>
      <link>http://vasters.com/clemensv/2012/10/19/Service+Bus+BeginSend+Is+No+Magic+Async+Pixie+Dust.aspx</link>
      <pubDate>Fri, 19 Oct 2012 09:29:10 GMT</pubDate>
      <description>&lt;p&gt;
I just got off the call with a customer and had a bit of a déjà vu from a meeting
at the beginning of the week, so it looks like the misconception I'll explain here
is a bit more common than I expected. 
&lt;/p&gt;
&lt;p&gt;
In both cases, the folks I talked to, had the about equivalent of the following code
in their app: 
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-FAMILY: Consolas"&gt;var qc = factory.CreateQueueClient(…);&lt;br&gt;
for( int i = 0; i &amp;lt; 1000; i++ ) 
&lt;br&gt;
{&lt;br&gt;
… create message …&lt;br&gt;
qc.BeginSend( msg, null, null );&lt;br&gt;
}&lt;br&gt;
qc.Close(); &lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
In both cases, the complaint was that messages were lost and strange exceptions occurred
in the logs – which is because, well, this doesn't do what they thought it does. 
&lt;/p&gt;
&lt;p&gt;
&lt;em&gt;BeginSend&lt;/em&gt; in the Service Bus APIs or other networking APIs as much as BeginWrite
on the file system isn't really doing the work that is requested. It is putting a
job into a job queue – the job queue of the I/O thread scheduler. 
&lt;/p&gt;
&lt;p&gt;
That means that once the code reaches &lt;em&gt;qc.Close()&lt;/em&gt; and you have also been mighty
lucky, a few messages may indeed have been sent, but the remaining messages will now
still sit in that job queue and scheduled for an object that the code just forced
to close. With the result that every subsequent send operation that is queued but
hasn't been scheduled yet will throw as you're trying to send on a disposed object.
Those messages will fail out and be lost inside the sender's process. 
&lt;/p&gt;
&lt;p&gt;
What's worse is that writing such code stuffs a queue that is both out of the app's
control and out of the app's sight and that all the arguments (which can be pretty
big when we talk about messages) dangle on those jobs filling up memory. Also, since
the app doesn't call &lt;em&gt;EndSend()&lt;/em&gt;, the application also doesn't pick up whatever
exceptions are potentially raised by the Send operation and flies completely blind.
If there is an EndXXX method for an async operation, you _must_ call that method even
if it doesn't return any values, because it might quite well throw you back what went
wrong. 
&lt;/p&gt;
&lt;p&gt;
So how should you do it? Don't throw messages blindly into the job queue. It's ok
to queue up a few to make sure there's a job in the queue as another one completes
(which is just slightly trickier than what I want to illustrate here), but generally
you should make subsequent sends depend on previous sends completing. In .NET 4.5
with async/await that's a lot easier now: 
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-FAMILY: Consolas"&gt;var qc = factory.CreateQueueClient(…);&lt;br&gt;
for( int i = 0; i &amp;lt; 1000; i++ ) 
&lt;br&gt;
{&lt;br&gt;
… create message …&lt;br&gt;
await task.Factory.FromAsync(qc.BeginSend, qc.EndSend, msg, null );&lt;br&gt;
}&lt;br&gt;
qc.Close(); &lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
Keep in mind that the primary goal of async I/O is to not waste threads and lose time
through excessive thread switching as threads hang on I/O operations. &lt;strong&gt;&lt;em&gt;It's
not making the I/O magically faster per-se&lt;/em&gt;&lt;/strong&gt;. We achieve that in the above
example as the compiler will break up that code into distinct methods where the loop
continues on an I/O thread callback once the Send operation has completed. 
&lt;/p&gt;
&lt;p&gt;
Summary: 
&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
Don't stuff the I/O scheduler queue with loads of blind calls to BeginXXX without
consideration for how the work gets done and completed and that it can actually fail 
&lt;li&gt;
Always call End and think about how many operations you want to have in flight and
what happens to the objects that are attached to the in-flight jobs&lt;/li&gt;
&lt;/ol&gt;
&lt;img width="0" height="0" src="http://vasters.com/clemensv/aggbug.ashx?id=abf20c1d-a3f3-4070-b54e-2a922156343a" /&gt;</description>
      <comments>http://vasters.com/clemensv/CommentView,guid,abf20c1d-a3f3-4070-b54e-2a922156343a.aspx</comments>
      <category>Architecture</category>
      <category>Technology</category>
    </item>
    <item>
      <trackback:ping>http://vasters.com/clemensv/Trackback.aspx?guid=ef5c9751-0614-460d-8d4d-106724b8ff22</trackback:ping>
      <pingback:server>http://vasters.com/clemensv/pingback.aspx</pingback:server>
      <pingback:target>http://vasters.com/clemensv/PermaLink,guid,ef5c9751-0614-460d-8d4d-106724b8ff22.aspx</pingback:target>
      <dc:creator>
      </dc:creator>
      <wfw:comment>http://vasters.com/clemensv/CommentView,guid,ef5c9751-0614-460d-8d4d-106724b8ff22.aspx</wfw:comment>
      <wfw:commentRss>http://vasters.com/clemensv/SyndicationService.asmx/GetEntryCommentsRss?guid=ef5c9751-0614-460d-8d4d-106724b8ff22</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I just got prompted to write this in an email reply and I think it's worth sharing. 
</p>
        <p>
My personal definition for ACID's Durability tenet is as follows: 
</p>
        <p>
          <em>"The outcome of the transaction outlasts the transaction, meaning that the result
of the transaction is published to other consumers as the transaction completes. ‘I’
resolves into ‘D’."</em>
        </p>
        <p>
People seem to think that there’s an implied guarantee on the outcome of the transaction
lasting forever. I don’t think that’s true and also believe that even the implication
is out of scope of the transaction mechanism. To me, all that ‘D’ says is that the
result of the transaction is published to subsequent consumers with the same reliability
assurances that apply for the same kind of data within the same system. That is to
say that if the system holds its operational data in volatile memory, committing to
and publishing in memory is sufficient. If the system stores operational data in a
replicated ring store in memory or if the system stores it on nonvolatile media, the
transaction outcome must be verifiably published following the common storage strategy
to satisfy ‘D’. It doesn’t have to be a spindle.
</p>
        <img width="0" height="0" src="http://vasters.com/clemensv/aggbug.ashx?id=ef5c9751-0614-460d-8d4d-106724b8ff22" />
      </body>
      <title>About the 'D' in ACID Transactions</title>
      <guid isPermaLink="false">http://vasters.com/clemensv/PermaLink,guid,ef5c9751-0614-460d-8d4d-106724b8ff22.aspx</guid>
      <link>http://vasters.com/clemensv/2012/10/12/About+The+D+In+ACID+Transactions.aspx</link>
      <pubDate>Fri, 12 Oct 2012 06:45:18 GMT</pubDate>
      <description>&lt;p&gt;
I just got prompted to write this in an email reply and I think it's worth sharing. 
&lt;/p&gt;
&lt;p&gt;
My personal definition for ACID's Durability tenet is as follows: 
&lt;/p&gt;
&lt;p&gt;
&lt;em&gt;"The outcome of the transaction outlasts the transaction, meaning that the result
of the transaction is published to other consumers as the transaction completes. ‘I’
resolves into ‘D’."&lt;/em&gt;
&lt;/p&gt;
&lt;p&gt;
People seem to think that there’s an implied guarantee on the outcome of the transaction
lasting forever. I don’t think that’s true and also believe that even the implication
is out of scope of the transaction mechanism. To me, all that ‘D’ says is that the
result of the transaction is published to subsequent consumers with the same reliability
assurances that apply for the same kind of data within the same system. That is to
say that if the system holds its operational data in volatile memory, committing to
and publishing in memory is sufficient. If the system stores operational data in a
replicated ring store in memory or if the system stores it on nonvolatile media, the
transaction outcome must be verifiably published following the common storage strategy
to satisfy ‘D’. It doesn’t have to be a spindle.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://vasters.com/clemensv/aggbug.ashx?id=ef5c9751-0614-460d-8d4d-106724b8ff22" /&gt;</description>
      <comments>http://vasters.com/clemensv/CommentView,guid,ef5c9751-0614-460d-8d4d-106724b8ff22.aspx</comments>
    </item>
  </channel>
</rss>