<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Udi Dahan - The Software Simplist &#187; NServiceBus</title>
	<atom:link href="http://www.udidahan.com/category/nservicebus/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.udidahan.com</link>
	<description>Enterprise Development Expert &#38; SOA Specialist</description>
	<lastBuildDate>Sun, 08 Jan 2012 12:45:00 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Talks, NServiceBus Beta, and Course Registration</title>
		<link>http://www.udidahan.com/2012/01/04/talks-nservicebus-beta-and-course-registration/</link>
		<comments>http://www.udidahan.com/2012/01/04/talks-nservicebus-beta-and-course-registration/#comments</comments>
		<pubDate>Wed, 04 Jan 2012 10:33:47 +0000</pubDate>
		<dc:creator>udidahan</dc:creator>
				<category><![CDATA[Community]]></category>
		<category><![CDATA[Courses]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[NServiceBus]]></category>
		<category><![CDATA[Presentations]]></category>

		<guid isPermaLink="false">http://www.udidahan.com/?p=1616</guid>
		<description><![CDATA[Some links to things that don&#8217;t fit anywhere else:
Andreas Ohlund&#8217;s talk on New and Shiny things in NServiceBus 3.0 is available here.
By the way, we&#8217;ve now got a beta out of NServiceBus 3.0 &#8211; get it here.
Yves Goeleven will be giving a talk on simplifying distributed application development with NServiceBus and the Windows Azure Platform [...]]]></description>
			<content:encoded><![CDATA[<p>Some links to things that don&#8217;t fit anywhere else:</p>
<p>Andreas Ohlund&#8217;s talk on New and Shiny things in NServiceBus 3.0 is available <a href="http://skillsmatter.com/podcast/open-source-dot-net/nservicebus-3">here</a>.</p>
<p>By the way, we&#8217;ve now got a beta out of NServiceBus 3.0 &#8211; get it <a href="http://www.nservicebus.com/NServiceBusV3NewFeatures.aspx">here</a>.</p>
<p>Yves Goeleven will be giving a talk on simplifying distributed application development with NServiceBus and the Windows Azure Platform on Jan 31 &#8211; <a href="https://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032501716&#038;Culture=nl-BE&#038;utm_source=dlvr.it&#038;utm_medium=twitter">details here</a>.</p>
<p>Carl and Richard over at Dot Net Rocks interviewed me at the Oredev conference in Sweden about Domain Driven Design and one of my pet peeves &#8211; the use of Customer in example applications. Get it <a href="http://www.dotnetrocks.com/default.aspx?showNum=724">here</a>.</p>
<p>I&#8217;m also happy to announce that registration for my 5-day Advanced Distributed Systems Design course has now opened for Bad Ems Germany and New York, in addition to the already open registrations for Austin TX and London. Information and registration on my <a href="http://www.udidahan.com/training/">training page</a>.</p>
<p>I&#8217;ve also made some progress with the recording of the course &#8211; you can now access days 1, 2, and part of day 3 &#8211; covering distributed systems theory, coupling, messaging patterns, bus and broker architectural style, SOA building blocks, and the hotel management SOA exercise. Information and purchase available <a href="https://www.flickrocket.com/eshop/Catalog2.aspx?CID=2956&#038;Theme=32">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.udidahan.com/2012/01/04/talks-nservicebus-beta-and-course-registration/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>NServiceBus Modelling Tools</title>
		<link>http://www.udidahan.com/2011/09/27/nservicebus-modelling-tools/</link>
		<comments>http://www.udidahan.com/2011/09/27/nservicebus-modelling-tools/#comments</comments>
		<pubDate>Tue, 27 Sep 2011 17:28:06 +0000</pubDate>
		<dc:creator>udidahan</dc:creator>
				<category><![CDATA[NServiceBus]]></category>

		<guid isPermaLink="false">http://www.udidahan.com/?p=1538</guid>
		<description><![CDATA[I&#8217;m happy to announce the availability of our newest modelling tools for NServiceBus. This first version includes Visual Studio integration and really makes developing with NServiceBus much more productive and enjoyable.
For more information, take a look at this video.

You can get this tool on our download page and also via the Visual Studio Gallery here.
]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m happy to announce the availability of our newest modelling tools for NServiceBus. This first version includes Visual Studio integration and really makes developing with NServiceBus much more productive and enjoyable.</p>
<p>For more information, take a look at <a href="http://vimeo.com/29659143">this video</a>.</p>
<p><iframe src="http://player.vimeo.com/video/29659143?byline=0&amp;portrait=0" width="400" height="225" frameborder="0" webkitAllowFullScreen allowFullScreen></iframe></p>
<p>You can get this tool on our <a href="http://www.nservicebus.com/Downloads.aspx">download page</a> and also via the Visual Studio Gallery <a href="http://visualstudiogallery.msdn.microsoft.com/c262316b-34da-45c8-9230-25adaf103803">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.udidahan.com/2011/09/27/nservicebus-modelling-tools/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>NServiceBus 2.6 Released</title>
		<link>http://www.udidahan.com/2011/09/05/nservicebus-2-6-released/</link>
		<comments>http://www.udidahan.com/2011/09/05/nservicebus-2-6-released/#comments</comments>
		<pubDate>Mon, 05 Sep 2011 19:45:19 +0000</pubDate>
		<dc:creator>udidahan</dc:creator>
				<category><![CDATA[NServiceBus]]></category>

		<guid isPermaLink="false">http://www.udidahan.com/?p=1510</guid>
		<description><![CDATA[This is an interesting release &#8211; one that we weren&#8217;t really planning on.
You see, the majority of our focus since releasing version 2.5 at the end of last year was to building our amazing new version 3.0 with all of its slick new coolness. But then we started getting requests from companies here and there [...]]]></description>
			<content:encoded><![CDATA[<p>This is an interesting release &#8211; one that we weren&#8217;t really planning on.</p>
<p>You see, the majority of our focus since releasing version 2.5 at the end of last year was to building our amazing new version 3.0 with all of its slick new coolness. But then we started getting requests from companies here and there using 2.5 to improve this small piece, that small piece, etc. </p>
<p>For a while, we thought we&#8217;d get version 3.0 out the door fast enough to address it all in one fell swoop. It turns out we couldn&#8217;t &#8211; version 3.0 had too many big changes in it that would take too long to stabilize. And thus, version 2.6 was born.</p>
<p><a href="http://www.nservicebus.com/">Get it here</a>.</p>
<h3>Customer Testimonial</h3>
<p>I&#8217;m also thrilled to announce that we got <strike>permission to go public about ****** </strike> one of the world&#8217;s largest investment banks using NServiceBus (publication pending final corporate approval). They were kind enough to provide us with this testimonial:</p>
<p><!--img src="http://www.nservicebus.com/img/barcap.gif" title="Barclays Capital" alt="Barclays Capital" height="52" width="150" style="display:none;"/--></p>
<blockquote><p>
NServiceBus is an exceptional framework for rapidly building enterprise applications. Not only was it easy to use out of the box, but the documentation was great and the large user community was very responsive. We were up and running with a prototype in a week.</p>
<p>We turned to NServiceBus for its performance and scalability for our new Structured Notes publishing systems. The reliability it provided us in integrating with other systems like Exchanges, IPA and code providers, as well as our internal systems allowed our developers to deliver on our core business objectives very quickly. </p>
<p>Like most large enterprises, we need full control of all of the internal behaviors of our infrastructure. We found the multiple layers of extensibility in NServiceBus gave us the control and flexibility we needed without sacrificing stability. </p>
<p>A truly exceptional framework. </p>
<p>&#8211; Manoj Oswal, VP &#8211; Structured Notes, Tier 1 Investment Bank
</p></blockquote>
<p>And in other news&#8230;</p>
<h3>We&#8217;re hiring!</h3>
<p>Business is booming and we&#8217;re looking to grow, currently focusing on the business side of the company. This includes project managers, practice managers, and program managers as well as sales and marketing people.</p>
<p>I&#8217;m also looking for a Chief Operating Officer who will be responsible for this group.</p>
<p>If you&#8217;re interested &#8211; please let us know: <a href="mailto:recruiting@nservicebus.com">recruiting@nservicebus.com</a></p>
<p>Our HR story isn&#8217;t yet very well developed so please bear with us as we ramp up.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.udidahan.com/2011/09/05/nservicebus-2-6-released/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>NServiceBus and RavenDB &#8211; better together!</title>
		<link>http://www.udidahan.com/2011/07/22/nservicebus-and-ravendb-better-together/</link>
		<comments>http://www.udidahan.com/2011/07/22/nservicebus-and-ravendb-better-together/#comments</comments>
		<pubDate>Fri, 22 Jul 2011 18:10:57 +0000</pubDate>
		<dc:creator>udidahan</dc:creator>
				<category><![CDATA[Databases]]></category>
		<category><![CDATA[ESB]]></category>
		<category><![CDATA[NServiceBus]]></category>
		<category><![CDATA[Pub/Sub]]></category>

		<guid isPermaLink="false">http://www.udidahan.com/?p=1505</guid>
		<description><![CDATA[For those of you who haven&#8217;t heard yet, the next version of NServiceBus will be making use of RavenDB as its default storage engine. 
What&#8217;s RavenDB?
For those of you who haven&#8217;t heard about RavenDB yet &#8211; it&#8217;s a transactional document database for .NET, and it&#8217;s been/being developed by my good friend and partner in crime [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.udidahan.com/wp-content/uploads/starsky1.jpg" alt="Better together" title="Better together" width="231" height="250" style="float:right; margin-left:10px; margin-bottom:10px;" />For those of you who haven&#8217;t heard yet, the next version of <a href="http://www.nservicebus.com">NServiceBus</a> will be making use of <a href="http://ravendb.net/">RavenDB</a> as its default storage engine. </p>
<h3>What&#8217;s RavenDB?</h3>
<p>For those of you who haven&#8217;t heard about RavenDB yet &#8211; it&#8217;s a transactional document database for .NET, and it&#8217;s been/being developed by my good friend and partner in crime <a href="http://ayende.com/blog">Ayende Rahien</a> (a.k.a Oren Eini). Although Ayende is known for his &#8220;not invented here&#8221; tendencies, when it comes to transactional document databases, well, you&#8217;d have been hard pressed to find one &#8211; especially with a decent .NET API.</p>
<h3>NServiceBus Storage</h3>
<p>In NServiceBus we have a variety of storage needs &#8211; from things like durable subscriptions so that you get fault-tolerant pub/sub, through persistence of long-running workflow (a.k.a saga) state, and durable timeouts so that your time-bound long-running processes never get stuck. None of these actually require relations &#8211; we were just using relational databases for storage because it was the easy answer everyone was going with.</p>
<h3>Relational vs. Document</h3>
<p>And these relational databases came with some downsides &#8211; developers had to &#8220;beg&#8221; their DBA to create the needed tables in the production databases, when that central database was down it prevented otherwise autonomous publishers and subscribers from going about their business, and it was very difficult to version the long-running workflows especially when newer versions required different state.</p>
<p>By moving to an embedded and transactional document DB, no longer do you need to bargain with the DBA, by keeping the storage together with the processing nodes you are back in parallel processing bliss, and the schema-less nature of the storage makes versioning those long-running workflows much easier.</p>
<h3>Licensing</h3>
<p>And I&#8217;m also happy to announce that an agreement has been reached with Hibernating Rhinos (Ayende&#8217;s company) so you won&#8217;t need to license RavenDB separately to get all of these benefits. RavenDB will be bundled with NServiceBus so licensing NServiceBus covers them both (for the storage needs mentioned above).</p>
<p>If you&#8217;re also thinking about using RavenDB as the storage for the rest of your system, you&#8217;ll be able to get a nice discount on the license when purchasing it together with NServiceBus. This will be going into effect with the release of NServiceBus 3.0 this October.</p>
<h3>Companies Using NServiceBus</h3>
<p>Interestingly enough, there&#8217;s been a big uptick in companies using NServiceBus with the introduction of licensing. Most of these companies are not the kind of big, stand-up-and-take-notice names that everybody likes to have on their roster.</p>
<p>What makes NServiceBus particularly attractive is that you can get a lot done without requiring some kind of dedicated BizTalk/WebSphere/Tibco expert. This has brought down the barrier for thousands of developers who just want to get on with the business of getting their app to market.</p>
<p>And when it comes to the big names, well, once they see how much faster they can get stuff done with NServiceBus as well as how robust and scalable it is in production, they don&#8217;t want any of their competitors to know about it!</p>
<p>Anyway, I&#8217;m glad to say that two companies have stepped forwards: Rackspace and Reuters. Hopefully we&#8217;ll get confirmation from one of the big banks soon that we can go public with them too.</p>
<p>Exciting times ahead.</p>
<p><center><a href="http://www.nservicebus.com"><img src="http://images.nservicebus.com/nServiceBus_Logo.png" title="learn more" alt="learn more" /></a></center></p>
]]></content:encoded>
			<wfw:commentRss>http://www.udidahan.com/2011/07/22/nservicebus-and-ravendb-better-together/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>NServiceBus Videos Online</title>
		<link>http://www.udidahan.com/2011/06/26/nservicebus-videos-online/</link>
		<comments>http://www.udidahan.com/2011/06/26/nservicebus-videos-online/#comments</comments>
		<pubDate>Sun, 26 Jun 2011 08:13:36 +0000</pubDate>
		<dc:creator>udidahan</dc:creator>
				<category><![CDATA[Community]]></category>
		<category><![CDATA[ESB]]></category>
		<category><![CDATA[MSMQ]]></category>
		<category><![CDATA[Messaging]]></category>
		<category><![CDATA[NServiceBus]]></category>
		<category><![CDATA[Presentations]]></category>
		<category><![CDATA[WCF]]></category>

		<guid isPermaLink="false">http://www.udidahan.com/?p=1480</guid>
		<description><![CDATA[When I was at NDC a couple of weeks ago, I got together with Carl Franklin and we recorded a DNR-TV episode on NServiceBus. If you&#8217;re looking for a zero-to-sixty, code-centric explanation of NServiceBus &#8211; this is it.
NServiceBus on DNR-TV
For some more advanced stuff, I suggest looking at the Hidden NServiceBus Gems talk that I [...]]]></description>
			<content:encoded><![CDATA[<p>When I was at NDC a couple of weeks ago, I got together with Carl Franklin and we recorded a DNR-TV episode on NServiceBus. If you&#8217;re looking for a zero-to-sixty, code-centric explanation of NServiceBus &#8211; this is it.</p>
<p><a href="http://dnrtv.com/default.aspx?ShowID=202">NServiceBus on DNR-TV</a></p>
<p>For some more advanced stuff, I suggest looking at the Hidden NServiceBus Gems talk that I gave at Skills Matter the week after. Here we get into all sorts of things that you won&#8217;t tend to find by yourself through regular usage of NServiceBus.</p>
<p><a href="http://skillsmatter.com/podcast/home/hidden-nservicebus-gems/js-1884">Hidden NServiceBus Gems</a></p>
<p>Enjoy.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.udidahan.com/2011/06/26/nservicebus-videos-online/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Integration: How and Where</title>
		<link>http://www.udidahan.com/2011/04/08/integration-how-and-where/</link>
		<comments>http://www.udidahan.com/2011/04/08/integration-how-and-where/#comments</comments>
		<pubDate>Fri, 08 Apr 2011 09:18:41 +0000</pubDate>
		<dc:creator>udidahan</dc:creator>
				<category><![CDATA[Architecture]]></category>
		<category><![CDATA[BizTalk]]></category>
		<category><![CDATA[ESB]]></category>
		<category><![CDATA[Messaging]]></category>
		<category><![CDATA[NServiceBus]]></category>
		<category><![CDATA[Pub/Sub]]></category>
		<category><![CDATA[SOA]]></category>

		<guid isPermaLink="false">http://www.udidahan.com/?p=1428</guid>
		<description><![CDATA[One of the topics that comes up a lot in the context of an Enterprise Service Bus (ESB) is that of integration. Unfortunately, many people take their ideas of reuse and design their integration as being done from a single place &#8211; both logical and physical. That unfortunately creates a bottleneck for all integration activities, [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.udidahan.com/wp-content/uploads/integration.jpg" alt="integration" title="integration" width="200" height="150" style="float:right; margin-left:10px; margin-bottom:10px;" />One of the topics that comes up a lot in the context of an Enterprise Service Bus (ESB) is that of integration. Unfortunately, many people take their ideas of reuse and design their integration as being done from a single place &#8211; both logical and physical. That unfortunately creates a bottleneck for all integration activities, where some are likely to be higher priority than others.</p>
<h3>The ugly truth</h3>
<p>You don&#8217;t need an ESB for integration.</p>
<p>There. I&#8217;ve said it. </p>
<p>Most of the ESB products on the market, in focusing on integration, are addressing the wrong problem.</p>
<h3>What integration is about</h3>
<p>There are three primary components to integration &#8211; data format translation, protocol bridging, and logic. Let&#8217;s take the Agile &#8220;simplest solution that could possibly work&#8221; motto and apply it to these elements:</p>
<ol>
<li>Data format translation<br/>
<ul>
<li>Use something like <a href="http://www.altova.com/mapforce.html">MapForce</a> (from Altova, the guys behind XMLSpy).</li>
<li>At under $1200 for a dev license and handling mapping to/from XML, EDI, flat files, and relational databases, you can host the resulting mapping in any endpoint, as XSLT or even Java/C# &#8211; no need to have &#8220;the bus&#8221; do this for you.</li>
</ul>
</li>
<li>Protocol bridging<br/>
<ul>
<li>Use something like <a href="http://www.nsoftware.com/subscriptions/">/n software</a></li>
<li>At about $1500 for a dev license, you get solutions for FTP, HTTP, SMTP, POP, IMAP, LDAP, DNS, RSS, SMS, Jabber, SOAP, WebDav, etc and, again &#8211; you can host the DLLs in any endpoint you want. Don&#8217;t need expensive buses for this</li>
</ul>
</li>
<li>Logic<br/><br />
This is all you &#8211; no technology can do this for you. If anything, the most important thing is to get all the ugly mapping and protocol bridging stuff out of the way and let you focus on your logic. This is Single Responsibility Principle (un)common sense.
</li>
</ol>
<h3>Digging deeper into the logic</h3>
<p>The interesting thing about most of the protocol stuff mentioned above is that they&#8217;re inherently <b>unreliable</b> and also their performance at runtime is unknowable due to the total load on the target server.</p>
<p>We wouldn&#8217;t want any of the above situations to cause our integration to &#8220;get stuck&#8221;. As such, it is best we think of our integration logic as a long-running process that manages other endpoints which do the actual protocol bridging and data transformations.</p>
<p>This is one of the areas where NServiceBus, with its <a href="http://www.nservicebus.com/Sagas.aspx">sagas</a> can actually help a lot. Just like the other pieces of integration mentioned above, these sagas can run on any endpoint.</p>
<p>You could alternatively look at other technologies like BizTalk and Business Process Execution Language (BPEL) engines, though many of those are designed to be physically centralized (just like many of the ESBs out there).</p>
<p>By the way, if you do want to use NServiceBus together with BizTalk, Michael Stephenson has published some great white papers on getting the two to work together. His latest is about integrating NServiceBus into BizTalk&#8217;s RFID processes &#8211; <a href="http://social.technet.microsoft.com/wiki/contents/articles/biztalk-rfid-amp-nservicebus.aspx">check it out</a>.</p>
<h3>Putting it all together</h3>
<p>When we take all of these pieces and look at them in a cohesive architecture, here&#8217;s what it can look like:</p>
<p><img src="http://www.udidahan.com/wp-content/uploads/DistributedIntegration.jpg" alt="Distributed Integration" title="Distributed Integration" width="600" height="385" class="alignnone size-full wp-image-1432" /></p>
<p>As you can see, integration is physically distributed across multiple endpoints.</p>
<p>Not only that, but the integration logic is kept separate from the protocol bridging and data transformation, enabling independent versioning of each. Just as important, it makes it <b>much</b> easier to unit test that the integration logic is correct as we don&#8217;t have to simulate the target technologies.</p>
<h3>Costs</h3>
<p>As you can see, you can get integration capabilities just as powerful as if you went with something like BizTalk, but without creating a single point of failure in your architecture. In terms of costs, it&#8217;s also quite a bit cheaper.</p>
<p>For a high availability BizTalk deployment, you&#8217;ll be paying <a href="http://www.microsoft.com/biztalk/en/us/pricing-licensing.aspx">over $40,000 per CPU</a> for the Enterprise Edition, not including the extra $7000 per CPU for SQL Server Standard Edition (clustered). For a clustered 4-CPU mid-size deployment, you&#8217;d be in the area of $200,000.</p>
<p>For the distributed integration solution above, you&#8217;d be paying around $2700 in dev licenses (for /n software and Altova MapForce), and $500 per core for NServiceBus Standard Edition. The reason there&#8217;s per-core licensing for NServiceBus is that in a virtualized environment, you&#8217;ll be provisioning virtual cores to your virtual machines. No reason to pay for a quad-core CPU when all you&#8217;re using is a single core. You can also use any number of cores running NServiceBus Express Edition at no cost, so a mid-size deployment with say 8 cores running Standard Edition, and another 24 cores running Express Edition would cost (with the volume discount) an additional $3800 &#8211; a total cost of $6,500.</p>
<p>BizTalk: $200,000 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NServiceBus: $6,500</p>
<p>&#8216;Nuff said.</p>
<h3>In closing</h3>
<p>We&#8217;ve been bitten by centralized architectures before.</p>
<p>By having our integration distributed, we can version, upgrade, and scale each piece independently.</p>
<p>You&#8217;ve seen how we can use simple, lightweight, and inexpensive technologies to create distributed integration solutions just as powerful and robust as the centralized ESB vendor-offerings out there, but at a tiny fraction of the cost.</p>
<p>Next time the topic of integration is brought up, you&#8217;ll know not to be suckered in by re-branded EAI brokers.</p>
<p><a href="http://www.nservicebus.com/">Learn more about NServiceBus</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.udidahan.com/2011/04/08/integration-how-and-where/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Bus and Broker Pub/Sub Differences</title>
		<link>http://www.udidahan.com/2011/03/24/bus-and-broker-pubsub-differences/</link>
		<comments>http://www.udidahan.com/2011/03/24/bus-and-broker-pubsub-differences/#comments</comments>
		<pubDate>Thu, 24 Mar 2011 21:22:13 +0000</pubDate>
		<dc:creator>udidahan</dc:creator>
				<category><![CDATA[Architecture]]></category>
		<category><![CDATA[BizTalk]]></category>
		<category><![CDATA[EDA]]></category>
		<category><![CDATA[ESB]]></category>
		<category><![CDATA[MSMQ]]></category>
		<category><![CDATA[Messaging]]></category>
		<category><![CDATA[NServiceBus]]></category>
		<category><![CDATA[Pub/Sub]]></category>
		<category><![CDATA[SOA]]></category>

		<guid isPermaLink="false">http://www.udidahan.com/?p=1421</guid>
		<description><![CDATA[One of the things which often confuses people using NServiceBus for the first time is that it only allows an endpoint to subscribe to a given event from a single other publishing endpoint. The rule that there can only be a single publisher for a given event type is one of the things that differentiates [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.udidahan.com/wp-content/uploads/difference_of_opinion.jpg" alt="differences" title="differences" width="250" height="150" style="float:right; margin-left:10px; margin-bottom:10px;" />One of the things which often confuses people using NServiceBus for the first time is that it only allows an endpoint to subscribe to a given event from a single other publishing endpoint. The rule that there can only be a single publisher for a given event type is one of the things that differentiates buses from brokers, though both obviously allow you to have multiple subscribers.</p>
<h3>Brokers</h3>
<p>Message brokers, more broadly known and used on the Java platform, don&#8217;t come with this constraint. For example, when using ActiveMQ, you can have any number of endpoints come to the broker and publish a message under a given topic. </p>
<p>So where&#8217;s the problem?</p>
<p>It&#8217;s all about accountability.</p>
<p>Let&#8217;s say you&#8217;ve subscribed to a given topic, and have received two events &#8211; one telling you that the price of bananas next week will be $1/kg and another telling you that it&#8217;ll be $2/kg. </p>
<p>Which one is right?</p>
<p>Especially given that those events may have been published by any other endpoint via the broker.</p>
<p>Is it first one wins? Last one wins? How about first one sent vs. first one received? Ditto for last. As a subscriber, can you really be held accountable for having the logic to choose the right one? Shouldn&#8217;t this responsibility have fallen to the publishing side?</p>
<p>This is one of the big drawbacks of the broker, hub and spoke architecture. No responsibility. No single source of truth &#8211; unless everybody&#8217;s going to some central database, in which case &#8211; what&#8217;s the point of all this messaging anyway?</p>
<h3>Buses</h3>
<p>The Bus Architectural Style is all about accountability. If you are going to publish an event, you are accountable for the correctness of the data in that event &#8211; there is no central database that a subscriber can go to &#8220;just in case&#8221;. And the only way that you can be held accountable, is if you have full responsibility &#8211; ergo, you&#8217;re the only one who can publish that type of event.</p>
<p>If you say bananas are going to cost $1/kg next week, that&#8217;s that. Subscribers will not hear from anybody else on that topic.</p>
<p>Now, this is not to say that you can&#8217;t have more than one <b>physical</b> publishing endpoint.</p>
<p>You see, buses differentiate between the logical and the physical. Brokers tend to assume that the physical hub-and-spoke topology is also the logical.</p>
<p>In a bus, while there can only be one <b>logical</b> endpoint publishing a given type of event, that endpoint can be physically scaled out across multiple machines. It is the responsibility of the bus to provide infrastructure facilities to allow for that to happen in such a way that to subscribers, it still appears as if there is really only one publishing endpoint.</p>
<p>The same is true about the subscriber &#8211; one logical subscribing endpoint may be scaled out across multiple machines.</p>
<h3>Product Mix-ups</h3>
<p>Unfortunately, there are many broker-style technologies out there that are being marketed under the banner of the Enterprise Service Bus. While some products have the ability to be deployed in both a centralized and distributed fashion (sometimes called &#8220;federated&#8221; or &#8220;embedded&#8221; mode), many do not enforce the &#8220;single publishing endpoint per event-type&#8221; rule.</p>
<p>Without this constraint, it is just too easy to make mistakes.</p>
<h3>NServiceBus</h3>
<p>By enforcing this constraint, we see the same kind of question appear on the discussion group time and time again:</p>
<p>&#8220;I have an Audit event that I&#8217;d like all of my machines to publish, and have one machine subscribe to them all, but NServiceBus won&#8217;t let me. How do I make NServiceBus support this scenario?&#8221;</p>
<p>And the answer is the same every time:</p>
<p>&#8220;You should have all the machines <b>Send</b> the Audit message (configured to go to the single machine handling that message), and not Publish. It is not an event until its been handled by the endpoint responsible for it.&#8221;</p>
<p>The semantics of the message matter a lot.</p>
<p>When looking at Service-Oriented Architecture, these messages are the contract and, as any lawyer will tell you, contracts need to be explicit and the intentions really need to be spelled out &#8211; otherwise the contract is practically worthless.</p>
<h3>In closing</h3>
<p>Friction is sometimes a good thing &#8211; it prevents us from making mistakes. It keeps cars on the road. And because that&#8217;s not enough friction, we introduce curbs as well.</p>
<p>If you&#8217;re looking for a service bus technology for your next project, check that it&#8217;ll give you the friction that you need to keep everybody safe. Really check what it is that the vendors are offering you &#8211; more often than not, it&#8217;s some ESB lipstick on a broker pig.</p>
<p>To learn more about how NServiceBus supports this kind of publish/subscribe, <a href="http://www.nservicebus.com/PubSub.aspx">click here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.udidahan.com/2011/03/24/bus-and-broker-pubsub-differences/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Careful with Content-Based Routing</title>
		<link>http://www.udidahan.com/2011/03/20/careful-with-content-based-routing/</link>
		<comments>http://www.udidahan.com/2011/03/20/careful-with-content-based-routing/#comments</comments>
		<pubDate>Sun, 20 Mar 2011 15:32:00 +0000</pubDate>
		<dc:creator>udidahan</dc:creator>
				<category><![CDATA[Architecture]]></category>
		<category><![CDATA[ESB]]></category>
		<category><![CDATA[Messaging]]></category>
		<category><![CDATA[NServiceBus]]></category>
		<category><![CDATA[SOA]]></category>

		<guid isPermaLink="false">http://www.udidahan.com/?p=1416</guid>
		<description><![CDATA[Every once in a while I get clients who ask me why NServiceBus doesn&#8217;t support content-based routing. My answer sometimes surprises them, &#8220;because it is a dangerous pattern that should usually be avoided&#8221;.
Content-Based Routing and ESBs
Since content-based routing often appears on feature lists for various ESBs, many people consider them to be a necessary part [...]]]></description>
			<content:encoded><![CDATA[<p>Every once in a while I get clients who ask me why NServiceBus doesn&#8217;t support content-based routing. My answer sometimes surprises them, &#8220;because it is a dangerous pattern that should usually be avoided&#8221;.</p>
<h2>Content-Based Routing and ESBs</h2>
<p>Since content-based routing often appears on feature lists for various ESBs, many people consider them to be a necessary part of systems built on SOA principles. The pattern also appears in the book Enterprise Integration Patterns, which apparently is also a convincing reason to use it, even though the book <a href="http://www.eaipatterns.com/ContentBasedRouter.html">specifically states</a>:</p>
<blockquote><p>
&#8220;When implementing a Content-Based Router, special caution should be taken to make the routing function easy to maintain as the router can become a point of frequent maintenance.&#8221;
</p></blockquote>
<p>That&#8217;s right &#8211; maintenance nightmare.</p>
<h2>For Example</h2>
<p>Let&#8217;s take a real-world example &#8211; a trading system where users can put orders for stock and for forex (money from other countries). </p>
<p>We&#8217;d start by creating a message that can be sent by a client:</p>
<p><!-- code formatted by http://manoli.net/csharpformat/ --></p>
<pre class="csharpcode">
<span class="kwrd">public</span> <span class="kwrd">class</span> PlaceOrder : IMessage
{
    <span class="kwrd">public</span> OrderTypeEnum OrderType { get; set; }
    <span class="kwrd">public</span> <span class="kwrd">string</span> Code { get; set; }
    <span class="kwrd">public</span> <span class="kwrd">double</span> Amount { get; set; }
}

<span class="kwrd">public</span> <span class="kwrd">enum</span> OrderTypeEnum
{
    Stock,
    Forex
}</pre>
<p>Clients would send messages by using code like the following:</p>
<pre class="csharpcode">
Bus.Send&lt;PlaceOrder&gt;(m =&gt; {
    m.OrderType = OrderTypeEnum.Stock;
    m.Code = <span class="str">"MSFT"</span>;
    m.Amount = 300;
    m.SetHeader("AccountId", myAccountId);
});</pre>
<p>The header is the way that clients identify themselves in the system.</p>
<p>Let&#8217;s say that the logic for handling the different types of orders is different, but also that we&#8217;d like the logic to be deployed to different endpoints. One reason we might want to do this is so that we can independently scale each of these endpoints. This is where it would appear we&#8217;d need some content-based routing &#8211; having some code that looks at the OrderType property and decides where to route based on its value.</p>
<p>Before we get into solutions, let&#8217;s make this more involved.</p>
<p>Not only do we want to route based on OrderType, but we want to use the account ID in the header to check in our database (or via a web service) if the account belongs to one of our VIP customers, and if so, it should be given higher priority. </p>
<h2>Content-Based Routing and Brokers</h2>
<p>We can see that if we were to go with a content-based routing solution, this would drive our architecture to a hub-and-spoke model where the hub becomes quite large and complex, as well as likely becoming a bottleneck in terms of performance.</p>
<p>This logically centralized place through which all communication flows defines the Broker architectural style &#8211; not that of a Bus. In the Bus architectural style, there is no logical (or physical) hub. You can think of it as a kind of peer-to-peer setup. Just like you wouldn&#8217;t want ethernet getting involved in applicative routing decisions, neither should your bus get involved.</p>
<h2>Business-Topology Mapping Solutions</h2>
<p>Instead, when following the Bus architectural style &#8211; we look at mapping stable business characteristics to bus-level topology. At one level, that would mean defining two different message types for our different types of trades:</p>
<p><!-- code formatted by http://manoli.net/csharpformat/ --></p>
<pre class="csharpcode">
<span class="kwrd">public</span> <span class="kwrd">abstract</span> <span class="kwrd">class</span> PlaceOrder
{
    <span class="kwrd">public</span> <span class="kwrd">string</span> Code { get; set; }
    <span class="kwrd">public</span> <span class="kwrd">double</span> Amount { get; set; }
}

<span class="kwrd">public</span> <span class="kwrd">class</span> PlaceStockOrder : PlaceOrder { }

<span class="kwrd">public</span> <span class="kwrd">class</span> PlaceForexOrder : PlaceOrder { }</pre>
<p>Once we have two different message types, then we can configure the client to have those statically sent to different endpoints like this:</p>
<p><!-- code formatted by http://manoli.net/csharpformat/ --></p>
<pre class="csharpcode">
<span class="kwrd">&lt;</span><span class="html">UnicastBusConfig</span><span class="kwrd">&gt;</span>
  <span class="kwrd">&lt;</span><span class="html">MessageEndpointMappings</span><span class="kwrd">&gt;</span>
    <span class="kwrd">&lt;</span><span class="html">add</span> <span class="attr">Messages</span><span class="kwrd">="Messages.PlaceStockOrder, Messages"</span> <span class="attr">Endpoint</span><span class="kwrd">="Stock"</span> <span class="kwrd">/&gt;</span>
    <span class="kwrd">&lt;</span><span class="html">add</span> <span class="attr">Messages</span><span class="kwrd">="Messages.PlaceForexOrder, Messages"</span> <span class="attr">Endpoint</span><span class="kwrd">="Forex"</span> <span class="kwrd">/&gt;</span>
  <span class="kwrd">&lt;/</span><span class="html">MessageEndpointMappings</span><span class="kwrd">&gt;</span>
<span class="kwrd">&lt;/</span><span class="html">UnicastBusConfig</span><span class="kwrd">&gt;</span></pre>
<p>And when it comes to handling our VIP customers, the recommendation would be to have those customers be served by a different set of web servers &#8211; we wouldn&#8217;t want a sudden flux in regular customers stealing all the HTTP connections from our VIP customers. Then we&#8217;d statically configure our VIP front-end to talk to our VIP back-end like this:</p>
<p><!-- code formatted by http://manoli.net/csharpformat/ --></p>
<pre class="csharpcode">
<span class="kwrd">&lt;</span><span class="html">UnicastBusConfig</span><span class="kwrd">&gt;</span>
  <span class="kwrd">&lt;</span><span class="html">MessageEndpointMappings</span><span class="kwrd">&gt;</span>
    <span class="kwrd">&lt;</span><span class="html">add</span> <span class="attr">Messages</span><span class="kwrd">="Messages.PlaceStockOrder, Messages"</span> <span class="attr">Endpoint</span><span class="kwrd">="VIP_Stock"</span> <span class="kwrd">/&gt;</span>
    <span class="kwrd">&lt;</span><span class="html">add</span> <span class="attr">Messages</span><span class="kwrd">="Messages.PlaceForexOrder, Messages"</span> <span class="attr">Endpoint</span><span class="kwrd">="VIP_Forex"</span> <span class="kwrd">/&gt;</span>
  <span class="kwrd">&lt;/</span><span class="html">MessageEndpointMappings</span><span class="kwrd">&gt;</span>
<span class="kwrd">&lt;/</span><span class="html">UnicastBusConfig</span><span class="kwrd">&gt;</span></pre>
<p>And the logic to identify VIP customers would be done in the login screen which, from there, would direct the user to the appropriate web server farm.</p>
<h2>Static vs. Dynamic</h2>
<p>It may appear that the above statically configured solution is less flexible then the afore-mentioned hub-and-spoke content-based routing solution. And that&#8217;s probably correct. But the question is, are the business requirements (better called &#8220;objectives&#8221; in this case) likely to change? If we make the technological solution 10x more flexible than the business needs, but at the cost of maintainability (read time to market), we probably haven&#8217;t used the right tool for the job.</p>
<p>Many times we can find stable business objectives and align the topology of our solution with them. Not all that is dynamic and flexible is necessarily better than that which is static.</p>
<p>I&#8217;d go so far to say that if a solution makes heavy use of content-based routing, it is likely a more fragile solution as implementations of stable business objectives and volatile requirements are mixed up together. </p>
<h2>In Closing</h2>
<p>NServiceBus intentionally does not support content-based routing so as not to make it easy for developers to make architectural blunders that could require full-system rewrites a couple of years down the road.</p>
<p>If you want to learn more about these kinds of architectural principles, I suggest coming to my <a href="http://www.udidahan.com/training/">course</a>. I&#8217;m afraid that New York City is already sold out, but I&#8217;ll be coming back to the US again around October. Stockholm, London, Sydney, and Oslo are now all open for registration.</p>
<p>Hope to see you there.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.udidahan.com/2011/03/20/careful-with-content-based-routing/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Webcast on NServiceBus with Andreas Öhlund</title>
		<link>http://www.udidahan.com/2011/03/06/webcast-on-nservicebus-with-andreas-ohlund/</link>
		<comments>http://www.udidahan.com/2011/03/06/webcast-on-nservicebus-with-andreas-ohlund/#comments</comments>
		<pubDate>Sun, 06 Mar 2011 23:52:28 +0000</pubDate>
		<dc:creator>udidahan</dc:creator>
				<category><![CDATA[Community]]></category>
		<category><![CDATA[NServiceBus]]></category>
		<category><![CDATA[Presentations]]></category>
		<category><![CDATA[Pub/Sub]]></category>

		<guid isPermaLink="false">http://www.udidahan.com/?p=1412</guid>
		<description><![CDATA[Tomorrow (March 8th) Andreas will be presenting a webcast on NServiceBus for the European Virtual ALT.NET group.
This will actually be part 2 of his previous presentation &#8211; you can find the recording of part 1 here.
This time Andreas will be showing publish/subscribe communication as well as the use of sagas &#8211; get the full details [...]]]></description>
			<content:encoded><![CDATA[<p>Tomorrow (March 8th) Andreas will be presenting a webcast on NServiceBus for the European Virtual ALT.NET group.</p>
<p>This will actually be part 2 of his previous presentation &#8211; you can find the recording of part 1 <a href="http://europevan.blogspot.com/2010/10/recording-of-andreas-ohlund-on.html">here</a>.</p>
<p>This time Andreas will be showing publish/subscribe communication as well as the use of sagas &#8211; get the full details <a href="http://europevan.blogspot.com/2011/02/andreas-ohlund-on-nservicebus-part-two.html">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.udidahan.com/2011/03/06/webcast-on-nservicebus-with-andreas-ohlund/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Polymorphism and Messaging</title>
		<link>http://www.udidahan.com/2011/01/13/polymorphism-and-messaging/</link>
		<comments>http://www.udidahan.com/2011/01/13/polymorphism-and-messaging/#comments</comments>
		<pubDate>Thu, 13 Jan 2011 08:52:48 +0000</pubDate>
		<dc:creator>udidahan</dc:creator>
				<category><![CDATA[Architecture]]></category>
		<category><![CDATA[BizTalk]]></category>
		<category><![CDATA[EDA]]></category>
		<category><![CDATA[ESB]]></category>
		<category><![CDATA[Messaging]]></category>
		<category><![CDATA[NServiceBus]]></category>
		<category><![CDATA[Pub/Sub]]></category>
		<category><![CDATA[WCF]]></category>
		<category><![CDATA[Web Services]]></category>

		<guid isPermaLink="false">http://www.udidahan.com/?p=1389</guid>
		<description><![CDATA[One of the questions that came up from my NServiceBus &#8211; .NET Service Bus Smackdown post was about the Polymorphic Message Dispatch and Polymorphic Message Routing features. People wanted to know what those are, why they&#8217;re important, and if other technologies (specifically WCF and BizTalk) support them.
Messaging Basics
First of all, when building a system using [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.udidahan.com/wp-content/uploads/polymorphism.jpg" alt="polymorphism" title="polymorphism" width="213" height="131" style="float:right; margin-left:10px; margin-bottom:10px;" />One of the questions that came up from my <a href="http://www.udidahan.com/2010/08/04/nservicebus-net-service-bus-smackdown/">NServiceBus &#8211; .NET Service Bus Smackdown post</a> was about the Polymorphic Message Dispatch and Polymorphic Message Routing features. People wanted to know what those are, why they&#8217;re important, and if other technologies (specifically WCF and BizTalk) support them.</p>
<h2>Messaging Basics</h2>
<p>First of all, when building a system using messaging, you don&#8217;t have methods that are invoked on some remote object (a.k.a &#8220;service&#8221;) to which you pass parameters. Instead, you use some generic piece of infrastructure (in the world of Java, this is most commonly a Message Broker) to send a message where a message can be thought of as a serializable class. Here&#8217;s an example of a message:</p>
<p><!-- code formatted by http://manoli.net/csharpformat/ --></p>
<pre class="csharpcode">
<span class="kwrd">public</span> <span class="kwrd">class</span> UserCreated : IMessage
{
    <span class="kwrd">public</span> Guid UserId { get; set; }
    <span class="kwrd">public</span> <span class="kwrd">string</span> Name { get; set; }
}</pre>
<p>This message would be published using NServiceBus like this:</p>
<p><!-- code formatted by http://manoli.net/csharpformat/ --></p>
<pre class="csharpcode">
bus.Publish&lt;UserCreated&gt;( m =&gt;
{
    m.UserId = Guid.NewGuid();
    m.Name = <span class="str">"John Smith"</span>;
});
</pre>
<p>This can be contrasted with RPC models like WCF where you need to define a &#8220;service&#8221; that has methods on it, where those methods accepts parameters. Sometimes developers try to make this more generic by having a single &#8220;service&#8221; with one method on it named something like &#8220;Process&#8221; where the parameter it accepts is of the type &#8220;object&#8221;, or they introduce generics like this: Process&lt;T&gt;(T message);</p>
<p>This is where Polymorphic Message Dispatch comes in:</p>
<h2>Polymorphic Message Dispatch</h2>
<p>While you can pull of the WCF generics thing, one thing that is more difficult (without writing your own dispatch model) is to have a pipeline of classes which can be invoked based on their relationship to the type passed in. Using NServiceBus, both of the following message handlers will be invoked when UserCreated arrives:</p>
<p><!-- code formatted by http://manoli.net/csharpformat/ --></p>
<pre class="csharpcode">
<span class="kwrd">public</span> <span class="kwrd">class</span> Persistence : IHandleMessages&lt;UserCreated&gt;
{
    <span class="kwrd">public</span> <span class="kwrd">void</span> Handle(UserCreated message) { }
}

<span class="kwrd">public</span> <span class="kwrd">class</span> Audit : IHandleMessages&lt;IMessage&gt;
{
    <span class="kwrd">public</span> <span class="kwrd">void</span> Handle(IMessage message) { }
}</pre>
<p>Now some might say that WCF, BizTalk, and the .NET Service Bus allow you to do auditing in their own internal pipeline, and that&#8217;s true. The place where this becomes more powerful is when you need to build V2 of your system, and the publisher now publishes a slightly different event &#8211; that a user was created as a part of a campaign, requiring the subscriber to register statistics about the campaign. Of course, this event also means that a user was created. Here&#8217;s how you&#8217;d do that with NServiceBus:</p>
<p><!-- code formatted by http://manoli.net/csharpformat/ --></p>
<pre class="csharpcode">
<span class="kwrd">public</span> <span class="kwrd">class</span> UserCreatedFromCampaign : UserCreated
{
    <span class="kwrd">public</span> Guid CampaignId { get; set; }
}

<span class="rem">//publisher code</span>
bus.Publish&lt;UserCreatedFromCampaign&gt;( m =&gt;
{
    m.UserId = Guid.NewGuid();
    m.Name = <span class="str">"John Smith"</span>;
    m.CampaignId = theCampaignId;
}

<span class="rem">//subscriber code</span>
<span class="kwrd">public</span> <span class="kwrd">class</span> Statistics : IHandleMessages&lt;UserCreatedFromCampaign&gt;
{
    <span class="kwrd">public</span> <span class="kwrd">void</span> Handle(UserCreatedFromCampaign message) { }
}</pre>
<p>The important part is what you don&#8217;t see &#8211; since UserCreatedFromCampaign inherits from UserCrated, the Persistence handler we had from V1 will also be invoked, and so will the Audit handler of course. You don&#8217;t have to make your new code call the old code like you would in a method based dispatch model. This makes sure that the coupling in your service layer code remains constant over time as you grow the functionality of your system.</p>
<p>This was one of the main benefits mentioned by Rackspace in their use of NServiceBus (<a href="http://www.nservicebus.com/Customers.aspx">here</a>):</p>
<blockquote><p>&#8220;The main benefit NServiceBus has brought us so far is developer scalability due to lower coupling and higher consistency in our code.&#8221;</p></blockquote>
<p>But, when looking at the above scenario, we can obviously expect that all sorts of things can happen in relation to campaigns &#8211; it is a separate concern, and thus should be handled by a separate subscriber. And this bring us to&#8230;</p>
<h2>Polymorphic Message Routing</h2>
<p>The challenge that we have here is that we no longer have a hierarchy where something clearly belongs on top of something else. We have users created and activities happening related to campaigns &#8211; that may happen in any combination. By having separate subscribers, we could then introduce new handlers/subscribers to our environment without touching or taking down any of the other subscribers. Here&#8217;s what the subscribers would look like:</p>
<p><!-- code formatted by http://manoli.net/csharpformat/ --></p>
<pre class="csharpcode">
<span class="kwrd">public</span> <span class="kwrd">class</span> Persistence : IHandleMessages&lt;UserCreated&gt;
{
    <span class="kwrd">public</span> <span class="kwrd">void</span> Handle(UserCreated message) { }
}

<span class="kwrd">public</span> <span class="kwrd">class</span> Statistics : IHandleMessages&lt;CampaignActivityOccurred&gt;
{
    <span class="kwrd">public</span> <span class="kwrd">void</span> Handle(CampaignActivityOccurred message) { }
}</pre>
<p>But if each of the above messages were a class, how could we define a message which inherited from both?</p>
<p>Before answering that, we need to understand why the publisher wouldn&#8217;t just publish both of the above messages. You see, the publisher can&#8217;t make any assumptions about its subscribers &#8211; it could be that one of them has logic that correlates across both of these messages that could end up counting the occurrence as happening twice rather than once, possibly charging the account associated with the campaign twice. Publishing two messages results in two transactions when there really should have been one.</p>
<p>So, here&#8217;s how to define messages so that we can have multiple inheritance:</p>
<p><!-- code formatted by http://manoli.net/csharpformat/ --></p>
<pre class="csharpcode">
<span class="kwrd">public</span> <span class="kwrd">interface</span> UserCreated : IMessage
{
    Guid UserId { get; set; }
    <span class="kwrd">string</span> Name { get; set; }
}

<span class="kwrd">public</span> <span class="kwrd">interface</span> CampaignActivityOccurred : IMessage
{
    Guid CampaignId { get; set; }
    Guid ActivityId { get; set; }
}

<span class="kwrd">public</span> <span class="kwrd">interface</span> UserCreatedFromCampaign
                 : UserCreated,
                   CampaignActivityOccurred
{
}</pre>
<p>And when the publisher publishes UserCreatedFromCampaign, the event would be routed to both the UserCreated subscriber and the CampaignActivityOccurred subscriber. The power of this approach is felt as we handle new requirements around purchases made related to a campaign. Now we can have another event which inherits from CampaignActivityOccurred and not have to worry since the existing subscriber will be routed those messages automatically.</p>
<p>Since WCF doesn&#8217;t have publish/subscribe capabilities, we might as well move along.</p>
<p>Not to throw a burning match on an ocean of oil, but REST doesn&#8217;t really support this either.</p>
<h2>Not Content-Based Routing</h2>
<p>This may sound like the <a href="http://www.eaipatterns.com/ContentBasedRouter.html">content-based router pattern from EIP</a> (CBR), but it&#8217;s not. The important difference is that there isn&#8217;t some part of the routing that depends on the structure of the messages. The major drawback of CBR is that it creates a central place in your system that needs to be changed any time *syntactic* changes happen to message structure *in addition to* to changes in the subscribers.</p>
<p>Now, this is where the BizTalk guys would say that &#8220;that&#8217;s why we can do message transformations&#8221;, and then the subscribers wouldn&#8217;t need to be changed. However, can we really know when getting a requirement that the change is syntactic and not semantic? I mean, it&#8217;s quite common that changes to message structures happen together with changes to processing logic. </p>
<p>You may be beginning to get the feeling that more and more logic is being sucked out of the subscribers into some monolithic black hole that is likely going to be unmaintainable and quite slow. </p>
<p>This is one of the main differences between using a bus and a broker &#8211; a bus supports the correct distribution of logic keeping the system loosely coupled; brokers are useful integration engines when you absolutely can&#8217;t change the applications being integrated. Enterprise Application Integration (EAI) brokers don&#8217;t usually make good Enterprise Service Bus (ESB) technology.</p>
<h2>In Closing</h2>
<p>NServiceBus has all sorts of features you didn&#8217;t know you needed until you saw what life could be like when you had them. Most of these features don&#8217;t have snazzy drag-and-drop demos that make people ooh-and-aah and TechEds and PDCs, but they&#8217;re really necessary to avoid finding yourself in yet another big-ball-of-mud code base telling your manager/customer (again) that it would be faster to rebuild the system from scratch than to implement that new requirement in the old one.</p>
<p>Take NServiceBus for a spin and <a href="http://www.nservicebus.com/">see for yourself</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.udidahan.com/2011/01/13/polymorphism-and-messaging/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>NServiceBus 2.5 Released</title>
		<link>http://www.udidahan.com/2010/12/31/nservicebus-2-5-released/</link>
		<comments>http://www.udidahan.com/2010/12/31/nservicebus-2-5-released/#comments</comments>
		<pubDate>Fri, 31 Dec 2010 16:12:44 +0000</pubDate>
		<dc:creator>udidahan</dc:creator>
				<category><![CDATA[EDA]]></category>
		<category><![CDATA[ESB]]></category>
		<category><![CDATA[MSMQ]]></category>
		<category><![CDATA[Messaging]]></category>
		<category><![CDATA[NServiceBus]]></category>
		<category><![CDATA[Pub/Sub]]></category>
		<category><![CDATA[Reliability]]></category>
		<category><![CDATA[WCF]]></category>
		<category><![CDATA[Web Services]]></category>

		<guid isPermaLink="false">http://www.udidahan.com/?p=1376</guid>
		<description><![CDATA[Just before we usher in the new year, I&#8217;m happy to announce the release of NServiceBus version 2.5.

Yes, there&#8217;s a new logo, and the website&#8217;s been redesigned.
It&#8217;s been a long time coming &#8211; the previous version (2.0) was released in March.
I&#8217;m really quite excited about this version as it rolls up all the bug fixes [...]]]></description>
			<content:encoded><![CDATA[<p>Just before we usher in the new year, I&#8217;m happy to announce the release of NServiceBus version 2.5.</p>
<p><a href="http://www.NServiceBus.com"><img src="http://www.nservicebus.com/img/nServiceBus_Logo.png" width="330" height="77" style="border:none;" alt="Go to the NServiceBus website" title="Go to the NServiceBus website" /></a></p>
<p>Yes, there&#8217;s a new logo, and the website&#8217;s been redesigned.<br />
It&#8217;s been a long time coming &#8211; the previous version (2.0) was released in March.</p>
<p>I&#8217;m really quite excited about this version as it rolls up all the bug fixes and enhancements that customers have asked for as they ran version 2.0 under the most severe types of production environments. The next thing that is a big deal that many have been asking for is a <strong>licensed</strong> version of NServiceBus &#8211; that is, the ability to purchase a commercial license and receive support.</p>
<p>We all know how managers like having a throat to choke.</p>
<p>And now they&#8217;ll have one &#8211; NServiceBus Ltd is the company that will be providing licensing, services, and support for all customers&#8217; NServiceBus needs. After more than 33,000 downloads and over 1000 developers in the community, the demand has really grown. Who would&#8217;ve thought all this would happen when I started NServiceBus 4 years ago (before it even had a name).</p>
<h3>Why NServiceBus is better than WCF for your distributed systems</h3>
<p>This question comes up repeatedly for people hearing about NServiceBus for the first time.</p>
<p>The answer is simple &#8211; reliability.</p>
<p>A system built with NServiceBus is so much more reliable to all kinds of production conditions than WCF that it&#8217;s hardly a fair comparison at all. While WCF can be configured to provide something kind of close to the same level of reliability, you need to do a fair amount of spelunking through the various options of netMsmqBinding to get it right. </p>
<p>The second reason to use NServiceBus instead of WCF is publish/subscribe.</p>
<p>The ability to make use of events and the observer pattern not just to achieve loose coupling within a single process, but across many processes, machines, and sites. Can you imagine going back to programming without events? Shudder. But that&#8217;s exactly what it&#8217;s like to use WCF in your distributed system. NServiceBus brings you the best of object-oriented programming but in a distributed and reliable infrastructure.</p>
<h3>Don&#8217;t wait any longer</h3>
<p>Take NServiceBus for a spin.</p>
<p>But things may look a bit different after you do&#8230;</p>
<p><img src="http://www.udidahan.com/wp-content/uploads/RedPillBluePill.jpg" alt="RedPillBluePill" title="RedPillBluePill" width="595" height="239" class="alignnone size-full wp-image-1384" /></p>
<p><a href="http://www.NServiceBus.com">http://www.NServiceBus.com</a></p>
<p>And have a happy New Year.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.udidahan.com/2010/12/31/nservicebus-2-5-released/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>NServiceBus Updates</title>
		<link>http://www.udidahan.com/2010/11/04/nservicebus-updates/</link>
		<comments>http://www.udidahan.com/2010/11/04/nservicebus-updates/#comments</comments>
		<pubDate>Thu, 04 Nov 2010 06:14:28 +0000</pubDate>
		<dc:creator>udidahan</dc:creator>
				<category><![CDATA[NServiceBus]]></category>

		<guid isPermaLink="false">http://www.udidahan.com/?p=1352</guid>
		<description><![CDATA[Just wanted to point you to some of the interesting new developments going on in the NServiceBus ecosystem.
For those of you looking at on-premise solutions but don&#8217;t want MSMQ and prefer a more &#8220;enterprise-ready&#8221; infrastructure, there is now an adapter for WebSphere MQ. This is already being used in production with NServiceBus version 1.9 and [...]]]></description>
			<content:encoded><![CDATA[<p>Just wanted to point you to some of the interesting new developments going on in the NServiceBus ecosystem.</p>
<p>For those of you looking at on-premise solutions but don&#8217;t want MSMQ and prefer a more &#8220;enterprise-ready&#8221; infrastructure, there is now an adapter for WebSphere MQ. This is already being used in production with NServiceBus version 1.9 and WebSphere MQ 6.x. <a href="http://using-enterprise-architecture.blogspot.com/2010/09/websphere-mq-adapter-for-nservicebus.html">Read more</a>.</p>
<p>For those of you looking at the cloud, Yves been doing some amazing work on getting NServiceBus to work on Azure. You can read about it <a href="http://cloudshaper.wordpress.com/2010/11/02/azure-queue-storage-support-for-nservicebus/">here</a>. As Ayende wrote about in his post about <a href="http://ayende.com/Blog/archive/2010/10/30/queuing-systems.aspx">queuing systems</a>, there is a big difference in how things like transactions work with local queues (like MSMQ) versus remote queues (like Azure queues).</p>
<p>I&#8217;m also happy to see that the community-driven <a href="http://www.nullreference.se/2010/11/03/getting-the-nservicebus-contrib-project-up-to-speed/">NServiceBus-Contrib effort</a> is beginning to pick up steam. We&#8217;ve now got more than 1000 people in the discussion group and a critical mass of community leaders able to answer almost all questions without my involvement &#8211; a truly scalable and sustainable ecosystem.</p>
<p>Currently the company using NServiceBus at the largest scale (that I know of) is <a href="http://www.conduit.com/">Conduit.com</a> with over 200 million users, the important thing being that they were able to do so without requiring thousands of servers (like the way MySpace did as described <a href="http://channel9.msdn.com/shows/Communicating/CCR-at-MySpace/">here</a>). I obviously can&#8217;t divulge how many servers Conduit.com is using, but suffice it to say that it&#8217;s an order of magnitude lower &#8211; that&#8217;s what true scalability is about, doing more with less.</p>
<p>Lots more interesting stuff is in the pipeline so keep watching.</p>
<p><a href="http://www.NServiceBus.com">Learn more about NServiceBus</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.udidahan.com/2010/11/04/nservicebus-updates/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Upcoming conferences and courses</title>
		<link>http://www.udidahan.com/2010/09/29/upcoming-conferences-and-courses/</link>
		<comments>http://www.udidahan.com/2010/09/29/upcoming-conferences-and-courses/#comments</comments>
		<pubDate>Thu, 30 Sep 2010 03:44:46 +0000</pubDate>
		<dc:creator>udidahan</dc:creator>
				<category><![CDATA[Community]]></category>
		<category><![CDATA[Consulting]]></category>
		<category><![CDATA[Courses]]></category>
		<category><![CDATA[NServiceBus]]></category>
		<category><![CDATA[Presentations]]></category>

		<guid isPermaLink="false">http://www.udidahan.com/?p=1345</guid>
		<description><![CDATA[Seeing as several hundred new subscribers have joined since my last post, I wanted to give a quick update on the courses I&#8217;m teaching (Advanced Distributed Systems Design and Enterprise Development with NServiceBus) as well as the conferences at which I&#8217;m presenting.
Hands-on
The NServiceBus course is actually different from what I previously delivered &#8211; the course [...]]]></description>
			<content:encoded><![CDATA[<p>Seeing as several hundred new subscribers have joined since my last post, I wanted to give a quick update on the courses I&#8217;m teaching (Advanced Distributed Systems Design and Enterprise Development with NServiceBus) as well as the conferences at which I&#8217;m presenting.</p>
<h2>Hands-on</h2>
<p>The NServiceBus course is actually different from what I previously delivered &#8211; the course has been extended from 2 days to 3 days and now has a much larger <b>hands-on</b> component for attendees. </p>
<p>The idea is that team leads and architects will likely be going to the 5-day distributed systems course, and then that the members of their teams go to this one. This 3-day course will have enough theory that attendees will know what the terms AC, BC, and Service mean, but the main focus will be on the concrete implementation of these concepts using NServiceBus &#8211; the actual building of reliable and scalable systems.</p>
<p>The next delivery planned for this course will be in London on Nov 8-10 &#8211; <a href="http://skillsmatter.com/course/open-source-dot-net/udi-dahan-nservicebus-workshop/ud-886">register here</a>.</p>
<p><br/></p>
<h2>Upcoming Advanced Distributed Systems Design</h2>
<p><a href="http://www.eventbee.com/view/udidahan-joburg">Oct 11-15: Johannesburg, South Africa</a></p>
<p><a href="http://www.sela.co.il/reg/default.aspx?CourseCode=AdvDistDahan_10069_1327_Sela&#038;BranchName=165&#038;lang=he-IL">Oct 24-28: Israel</a></p>
<p><a href="http://skillsmatter.com/course/open-source-dot-net/advanced-distributed-systems-design-with-soa/ps-314">Nov 1-5: London, UK</a></p>
<p><a href="http://udidahan-sydney.eventbee.com/">Nov 22-26: Sydney, Australia</a></p>
<p><a href="http://udidahan-seattle.eventbee.com/">Dec 13-17: Seattle WA, USA</a></p>
<p>Information on the Advanced Distributed Systems Design course can be found <a href="http://www.udidahan.com/training/#Advanced_Distributed_System_Design">here</a>.</p>
<p><br/></p>
<h2>Upcoming conferences</h2>
<p><a href="http://www.prioconference.de/">Oct 19-20: Prio Conference &#8211; Nurnberg, Germany</a></p>
<p>I&#8217;m also giving a post-conference workshop on NServiceBus &#8211; <a href="http://www.prioconference.de/Programm/prio.workshops-21.10/prio.workshop-Enterprise-Development-with-NServiceBus">details here</a>.</p>
<p><a href="http://www.yowconference.com.au/melbourne/speakers/details.html?speakerId=1847">YOW Australia &#8211; Melbourne, Dec 2-3</a></p>
<p>*  I have one free day of consulting left between my course and the conference &#8211; if you&#8217;re interested, and the beginning of December in Sydney or Melbourne works for you, contact me at <a href="mailto:consult@udidahan.com">consult@udidahan.com</a></p>
<p><br/></p>
]]></content:encoded>
			<wfw:commentRss>http://www.udidahan.com/2010/09/29/upcoming-conferences-and-courses/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Race Conditions Don&#8217;t Exist</title>
		<link>http://www.udidahan.com/2010/08/31/race-conditions-dont-exist/</link>
		<comments>http://www.udidahan.com/2010/08/31/race-conditions-dont-exist/#comments</comments>
		<pubDate>Tue, 31 Aug 2010 09:56:46 +0000</pubDate>
		<dc:creator>udidahan</dc:creator>
				<category><![CDATA[Architecture]]></category>
		<category><![CDATA[BPM]]></category>
		<category><![CDATA[Business Rules]]></category>
		<category><![CDATA[CQRS]]></category>
		<category><![CDATA[NServiceBus]]></category>
		<category><![CDATA[Pub/Sub]]></category>
		<category><![CDATA[Workflow]]></category>

		<guid isPermaLink="false">http://www.udidahan.com/?p=1335</guid>
		<description><![CDATA[Not in the business world anyway.
The problem is that, as software developers, we&#8217;re all too quick to accept them at face value. We don&#8217;t question the requirements &#8211; in all fairness, it was never our job to do so. We were the ones that implemented them, preferably quickly. 
For example
Let&#8217;s say we get the requirement [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.udidahan.com/wp-content/uploads/crossing-the-finish-line1.jpg" alt="crossing-the-finish-line" title="crossing-the-finish-line" width="200" height="159" style="float:right; margin-left:10px; margin-bottom:10px;"  />Not in the business world anyway.</p>
<p>The problem is that, as software developers, we&#8217;re all too quick to accept them at face value. We don&#8217;t question the requirements &#8211; in all fairness, it was never our job to do so. We were the ones that implemented them, preferably quickly. </p>
<h3>For example</h3>
<p>Let&#8217;s say we get the requirement the following requirements:</p>
<p>1. If the order was already shipped, don&#8217;t let the user cancel the order.<br />
2. If the order was already cancelled, don&#8217;t let the user ship the order.</p>
<p>The race condition here is when we have two users who are looking at the same order, which is neither cancelled nor shipped yet, and each submits a command &#8211; one to ship the order, the other to cancel it.</p>
<p>In these cases, the code is simple &#8211; just an if statement before performing the relevant command.</p>
<h3>So what&#8217;s the problem</h3>
<p>A microsecond difference in timing shouldn&#8217;t make a difference to core business behaviors. Which means that we&#8217;ve actually got here is a bug in the requirements. Users are actually dictating solutions here rather than requirements.</p>
<p>Let&#8217;s ask our stakeholders, &#8220;why shouldn&#8217;t we let users cancel a shipped order? I mean, the users don&#8217;t want the products.&#8221;</p>
<p>And the stakeholders would respond with something like, &#8220;well, we don&#8217;t want to refund the user&#8217;s money then. Or, at least, not all their money. Well, maybe if they return the products in their original packaging, *then* we could give a full refund.&#8221;</p>
<p>And as we drilled deeper, &#8220;when do refunds need to be given? Right away, in the same transaction?&#8221;</p>
<p>The stakeholders would explain, &#8220;no, refunds don&#8217;t need to be given right away.&#8221;</p>
<p>It turns out we were missing the concept of a refund, as well as assuming that all things needed to be processed and enforced immediately. Once we dug into the requirements, we found that there is actually plenty of time to allow both transactions to go through. We just need to add some checks during shipping&#8217;s long-running process to see if the order was cancelled, and then to cut the process short.</p>
<h3>So is everything a long-running process then?</h3>
<p>That&#8217;s actually a fair question &#8211; long-running processes are a lot more common than at first appears.</p>
<p>What we&#8217;re seeing is that cancellation is now a command that has no reason to fail &#8211; just like <a href="http://www.udidahan.com/2009/12/09/clarified-cqrs">CQRS</a> tells us. When this command is performed, it publishes the OrderCancelled event, which the billing service subscribes to. </p>
<p>Billing then starts a long-running process (a saga, in <a href="http://www.NServiceBus.com">NServiceBus</a> lingo), also listening to events from the shipping process, ultimately making a decision when a refund should be given, and for how much.</p>
<h3>Deeper business analysis</h3>
<p>As we discuss matters more with our business stakeholders, we hear that most orders are actually cancelled within an hour of being submitted. It is quite rare for orders to be cancelled days later.</p>
<p>In which case, we could look at modeling the acceptance of an order as a long-running process itself.</p>
<p>When a user places an order, we don&#8217;t immediately publish an event indicating the acceptance of an order, instead a saga is kicked off &#8211; which opens up a timeout for an hour later. If a cancellation command arrives during that period of time, the user gets a full refund (seeing as we didn&#8217;t charge anything since billing didn&#8217;t get the accepted event to begin with), and the saga just shuts itself down. If the timeout occurs an hour later, and the saga didn&#8217;t get a cancel command, then the order is actually accepted and the event is published.</p>
<p>Yes, sagas are everywhere, once you learn to see with business eyes, and no race conditions are left.</p>
<h3>In closing</h3>
<p>Any time you see requirements that indicate a race condition, dig deeper.</p>
<p>What you&#8217;re likely to find are some additional business concepts as well as the introduction of time and the creation of long-running business processes. The implementation at that point will pivot from being trivial if-statements to being richer sagas.</p>
<p>Keep an eye out.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.udidahan.com/2010/08/31/race-conditions-dont-exist/feed/</wfw:commentRss>
		<slash:comments>24</slash:comments>
		</item>
		<item>
		<title>NServiceBus &#8211; .NET Service Bus Smackdown</title>
		<link>http://www.udidahan.com/2010/08/04/nservicebus-net-service-bus-smackdown/</link>
		<comments>http://www.udidahan.com/2010/08/04/nservicebus-net-service-bus-smackdown/#comments</comments>
		<pubDate>Wed, 04 Aug 2010 11:24:39 +0000</pubDate>
		<dc:creator>udidahan</dc:creator>
				<category><![CDATA[MSMQ]]></category>
		<category><![CDATA[Messaging]]></category>
		<category><![CDATA[NServiceBus]]></category>
		<category><![CDATA[WCF]]></category>
		<category><![CDATA[Web Services]]></category>

		<guid isPermaLink="false">http://www.udidahan.com/?p=1322</guid>
		<description><![CDATA[I get this question quite often: &#8220;what is the difference between NServiceBus and the .NET Service Bus from Microsoft?&#8221; And I&#8217;m afraid the answer is that the two technologies were designed to handle a very different set of problems. 
The .NET Service Bus was designed to bridge internet communications using the cloud to enable a [...]]]></description>
			<content:encoded><![CDATA[<p>I get this question quite often: &#8220;what is the difference between NServiceBus and the .NET Service Bus from Microsoft?&#8221; And I&#8217;m afraid the answer is that the two technologies were designed to handle a very different set of problems. </p>
<p>The .NET Service Bus was designed to bridge internet communications using the cloud to enable a variety of devices to communicate using a WCF-remote-procedure-call type of API. NServicebus was designed to simplify the design of on-premise distributed systems using reliable messaging.</p>
<p>Still, people seem to want a kind of comparison, so here&#8217;s a quick one off-the-top-of-my-head:</p>
<table style="text-align:center; font-size:12px;" border="1">
<tr style="font-weight:bold; font-size:16px;">
<td>Feature</td>
<td>.NET Service Bus</td>
<td>NServiceBus</td>
</tr>
<tr>
<td>Cloud-based messaging</td>
<td>Yes</td>
<td>No</td>
</tr>
<tr>
<td>Internet-spanning communication</td>
<td>Yes</td>
<td>Yes &#8211; via additional gateway process</td>
</tr>
<tr>
<td>Lightweight client support</td>
<td>Yes</td>
<td>Yes &#8211; via exposed WCF endpoint</td>
</tr>
<tr>
<td>Full duplex communication</td>
<td>Yes</td>
<td>Yes &#8211; not including lightweight clients</td>
</tr>
<tr>
<td>Publish / Subscribe support</td>
<td>Yes</td>
<td>Yes</td>
</tr>
<tr>
<td>Interop with non-.Net platforms</td>
<td>Yes</td>
<td>Yes</td>
</tr>
<tr>
<td>Maximum message size</td>
<td>64 KB</td>
<td>4012 KB</td>
</tr>
<tr>
<td>Long-running stateful processes</td>
<td>Using WF on top</td>
<td>Yes</td>
</tr>
<tr>
<td>On-premise messaging</td>
<td>No</td>
<td>Yes</td>
</tr>
<tr>
<td>Client can send messages if server is offline</td>
<td>No</td>
<td>Yes</td>
</tr>
<tr>
<td>Poison message detection and dispatching</td>
<td>No</td>
<td>Yes</td>
</tr>
<tr>
<td>Poison messages re-processing</td>
<td>No</td>
<td>Yes</td>
</tr>
<tr>
<td>Subscriptions persist after restart</td>
<td>No</td>
<td>Yes</td>
</tr>
<tr>
<td>Polymorphic message dispatch</td>
<td>No</td>
<td>Yes</td>
</tr>
<tr>
<td>Polymorphic message routing</td>
<td>No</td>
<td>Yes</td>
</tr>
<tr>
<td>Message-driven unit testing</td>
<td>No</td>
<td>Yes</td>
</tr>
</table>
<p>This is not meant to be an exhaustive list, or even an accurate representation of the relative strengths and weaknesses of the technologies because, as I said, they&#8217;re designed for different purposes. </p>
<p>One could even plug the .NET Service Bus into NServiceBus instead of its MSMQ transport to get broad reach where required, and then switching back to the on-premise strengths of MSMQ. The pluggability of NServiceBus makes it easy to swap out almost all implementation components like the subscription storage, transport, authorization mechanisms, containers, etc.</p>
<p>For more information on the .NET Service Bus see the <a href="http://www.microsoft.com/windowsazure/appfabric/">Azure AppFabric page</a>. Juval Lowey also has a nice article on it up on MSDN magazine <a href="http://msdn.microsoft.com/en-us/magazine/dd569756.aspx">here</a>.</p>
<p>For more information on NServiceBus see the <a href="http://www.NServiceBus.com">NServiceBus site</a>. Also take a look at the pages giving you comparisons to WCF and BizTalk.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.udidahan.com/2010/08/04/nservicebus-net-service-bus-smackdown/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Cautiously Merging IL</title>
		<link>http://www.udidahan.com/2010/08/01/cautiously-merging-il/</link>
		<comments>http://www.udidahan.com/2010/08/01/cautiously-merging-il/#comments</comments>
		<pubDate>Sun, 01 Aug 2010 07:16:53 +0000</pubDate>
		<dc:creator>udidahan</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[NServiceBus]]></category>
		<category><![CDATA[Simplicity]]></category>

		<guid isPermaLink="false">http://www.udidahan.com/?p=1318</guid>
		<description><![CDATA[As Dru mentioned on his blog, while having dinner in Kansas City, I described why NServiceBus makes use of IL Merge and some of the challenges we were facing with version management as a result. While I do think that we&#8217;ve managed to find the right balance, I must say that it wasn&#8217;t easy and [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.udidahan.com/wp-content/uploads/merge.gif" alt="Caution, Merge Ahead" title="Caution, Merge Ahead" width="200" height="200" style="float:right; margin-left:10px; margin-bottom:10px;" />As Dru <a href="http://codebetter.com/blogs/dru.sellers/archive/2010/07/29/ilmerge-to-the-rescue.aspx">mentioned on his blog</a>, while having dinner in Kansas City, I described why NServiceBus makes use of IL Merge and some of the challenges we were facing with version management as a result. While I do think that we&#8217;ve managed to find the right balance, I must say that it wasn&#8217;t easy and I urge other developers use caution when employing it.</p>
<h3>Mistakes Made</h3>
<p>In the previous version of NServiceBus (1.9) we over aggresively merged 3rd party libraries like Castle into the NServiceBus binaries. That in itself, wasn&#8217;t the big problem. The problem was that we didn&#8217;t know about <i>internalizing</i> the libraries we merged. </p>
<p>This resulted in all the 3rd party types being exposed when a developer used NServiceBus. For those who happened to use the same version of those libraries as that which was merged, it wasn&#8217;t a problem. Unfortunately, developers who used libraries like Castle tended to be very particular about which version they used &#8211; which resulted in version conflicts, also known as &#8220;versioning hell&#8221;.</p>
<h3>Internalization Challenges</h3>
<p>As we moved to NServiceBus 2.0, we were a lot more careful about which libraries were merged and made sure to internalize them as much as possible. Yes, you read that right, &#8220;as much as possible&#8221;. You can&#8217;t always internalize all the types of a given library.</p>
<p>For example, NServiceBus internally uses NHibernate to persist the state of long-running processes (called sagas) and we want this implementation detail to not conflict with anything that developers want to do on top of NServiceBus. The only thing is that for NHibernate to work, it needs certain types to be exposed to the configuration environment, specifically all the types in the NHibernate.Cfg.MappingSchema namespace.</p>
<h3>Extensibility Challenges</h3>
<p>Once you take on an external dependency, you want to configure it to &#8220;just work&#8221; so that developers that aren&#8217;t familiar with it don&#8217;t have to learn yet another library to use your framework. So far, we&#8217;ve been able to do that quite successfully with NServiceBus. The challenge comes when developers want to customize the behavior of those 3rd party libraries, wanting to call into their APIs.</p>
<p>You see, once you internalize those libraries and their types, developers can&#8217;t access them. This leads to all sorts of tricky extensibility problems especially for different kinds of developers. Some are happy enough to configure things from the outside using XML &#8211; like using hbm.xml files to describe how their sagas get persisted, while others really want to use Fluent NHibernate, which is fully internalized.</p>
<h3>Finding a Balance</h3>
<p>What we&#8217;ve currently got for NServiceBus to try to keep everyone happy is a progressive exposure model. From the developer who&#8217;s downloading NServiceBus for the first time and wants everything to just work without changing anything, our API unfolds in multiple dimensions to allow for the highest level of extensibility and pluggability. That being said, the Fluent NHibernate issue mentioned above isn&#8217;t solvable at just an API level.</p>
<p>In order to address the class of developer that wants full control, we&#8217;ve got a &#8220;core only&#8221; build that doesn&#8217;t merge any assemblies into it. This class of developer usually doesn&#8217;t have a problem with referencing some more assemblies as long as they retain full control of the behaviors they want.</p>
<p>It ain&#8217;t easy keeping everybody happy, or, at least, not unhappy.</p>
<h3>In Closing</h3>
<p>I would agree that more OSS frameworks should merge and internalize 3rd party libraries that don&#8217;t need to be exposed to developers &#8211; it shortens the learning curve and increases adoption. But walk this path cautiously, it&#8217;s hard striking a balance that will work all users of your framework and it takes quite some time to get it right.</p>
<p>And one last thing, please, PLEASE, take care of maintaining binary compatibility from one version to the next. I know it&#8217;s a pain &#8211; we&#8217;ve been doing it with NServiceBus for the past 3 years, but your users will thank you for it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.udidahan.com/2010/08/01/cautiously-merging-il/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Evolving Loosely-Coupled Frameworks &amp; Apps</title>
		<link>http://www.udidahan.com/2010/07/14/evolving-loosely-coupled-frameworks-and-apps/</link>
		<comments>http://www.udidahan.com/2010/07/14/evolving-loosely-coupled-frameworks-and-apps/#comments</comments>
		<pubDate>Wed, 14 Jul 2010 13:10:18 +0000</pubDate>
		<dc:creator>udidahan</dc:creator>
				<category><![CDATA[Architecture]]></category>
		<category><![CDATA[Dependency Injection]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[NServiceBus]]></category>
		<category><![CDATA[OO]]></category>
		<category><![CDATA[Simplicity]]></category>

		<guid isPermaLink="false">http://www.udidahan.com/?p=1312</guid>
		<description><![CDATA[This post will be less of a big-concept type posts I usually do, and more of a tip for people building and maintaining infrastructure and frameworks either open-source or internally for their companies. I&#8217;m going to illustrate this with NServiceBus as it is a large enough code base to have significant complexity and open so [...]]]></description>
			<content:encoded><![CDATA[<p>This post will be less of a big-concept type posts I usually do, and more of a tip for people building and maintaining infrastructure and frameworks either open-source or internally for their companies. I&#8217;m going to illustrate this with NServiceBus as it is a large enough code base to have significant complexity and open so that you can go and take a look yourself. Trying to include some example in here would be just too small to be useful or for the point to come across.</p>
<h3>Some background</h3>
<p>As a cohesive framework, NServiceBus makes it quite easy for developers to pick and choose which settings they want turned on and off. Being built as a loosely-coupled set of components that don&#8217;t know about each other has always kept the internal complexity low. But as the NServiceBus API has been evolving over the years, and the functionality offered has increased, some interesting challenges have popped up as the codebase has been refactored. </p>
<h3>The challenge</h3>
<p>The UnicastBus class has grown too large and it&#8217;s time to refactor something out. Coincidentally, users have been asking for a better &#8220;header&#8221; story for messages &#8211; the ability to specify static headers that will be appended to all messages being sent (useful for things like security tokens), as well as per message headers. So, we want to refactor all the header management out to its own component independent of the UnicastBus class.</p>
<p>So, here&#8217;s the issue. So far, users have specified &#8220;.UnicastBus()&#8221; as a part of the fluent code-configuration, and shouldn&#8217;t have to change that &#8211; they shouldn&#8217;t need to know that header management is now a separate component. But then how can the new component bootstrap itself into the startup, such that it gets all the dependency injection facilities of the rest of the framework? Remember that the component doesn&#8217;t know which container technology is being used (since the user can swap it out) or when the container has been set.</p>
<h3>The solution</h3>
<p>The only part of the framework that knows about when all DI configuration is set is the configuration component, thus it will have to be the one that invokes the new component (without knowing about it). Introduce an interface (say INeedInitialization) and scan all the types loaded looking for classes which implement that type, register them into the container, and invoke them. Have the new component implement that interface, and in its initialization have it hook into the events and/or pipelines of other parts of the system.</p>
<h3>Other uses</h3>
<p>One historically problematic area in NServiceBus has been people forgetting to call &#8220;.LoadMessageHandlers()&#8221;. This can now be wired in automatically by a class in the UnicastBus component via the same mechanism.</p>
<p>A new feature coming in the next version is the &#8220;data bus&#8221;, a component which will allow sending large quantities of data through the bus without going through the messaging pipelines. This will help people get around the 4MB limit of MSMQ and, even more importantly, the much smaller 8KB limit of Azure. We will be able to introduce the functionality transparently with the same mechanism.</p>
<p>As an extension point, developers can now enrich the NServiceBus framework with their own capabilities and make those available via the contrib project to the community at large. This is better than the IWantToRunAtStartup interface that was only available for those using the generic host (which excluded web apps) and gives a consistent extensibility story for all uses.</p>
<h3>Summary</h3>
<p>Extensibility has always been a challenge when writing object-oriented code and dependency injection techniques have helped, but sometimes you need a bit more to take things to the next level while maintaining a backwards-compatible API.</p>
<p>Like I said, not a ground-shaking topic but something quite necessary in creating loosely-coupled frameworks and applications. Once you know it&#8217;s there, it isn&#8217;t really a big deal. If you didn&#8217;t know to do it, you may have been contorting your codebase in all kinds of ways to try to achieve similar things.</p>
<p>If you want to take a look at the code, you can find the SVN repository here: https://nservicebus.svn.sourceforge.net/svnroot/nservicebus/trunk/</p>
]]></content:encoded>
			<wfw:commentRss>http://www.udidahan.com/2010/07/14/evolving-loosely-coupled-frameworks-and-apps/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>CQRS, DDD, and NServiceBus video</title>
		<link>http://www.udidahan.com/2010/06/18/cqrs-ddd-and-nservicebus-video/</link>
		<comments>http://www.udidahan.com/2010/06/18/cqrs-ddd-and-nservicebus-video/#comments</comments>
		<pubDate>Fri, 18 Jun 2010 11:11:19 +0000</pubDate>
		<dc:creator>udidahan</dc:creator>
				<category><![CDATA[CQRS]]></category>
		<category><![CDATA[DDD]]></category>
		<category><![CDATA[NServiceBus]]></category>
		<category><![CDATA[Presentations]]></category>

		<guid isPermaLink="false">http://www.udidahan.com/?p=1306</guid>
		<description><![CDATA[Following the theme of my last few blog posts, this post will also be pointing you to videos of me talking.
After I had finished speaking at QCon London last March, I sat down for a short interview with the guys from InfoQ chatting about topics from CQRS, to DDD, to NServiceBus. I&#8217;m happy to say [...]]]></description>
			<content:encoded><![CDATA[<p>Following the theme of my last few blog posts, this post will also be pointing you to videos of me talking.</p>
<p>After I had finished speaking at QCon London last March, I sat down for a short interview with the guys from InfoQ chatting about topics from CQRS, to DDD, to NServiceBus. I&#8217;m happy to say that the interview is now online with a full (and mostly accurate) transcript as well as with an MP3 download link.</p>
<p>Get it here: <a href="http://www.infoq.com/interviews/dahan-cqrs-ddd-nservicebus">Udi Dahan on CQRS, DDD and NServiceBus</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.udidahan.com/2010/06/18/cqrs-ddd-and-nservicebus-video/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>NServiceBus Presentation Now Online</title>
		<link>http://www.udidahan.com/2010/06/09/nservicebus-presentation-now-online/</link>
		<comments>http://www.udidahan.com/2010/06/09/nservicebus-presentation-now-online/#comments</comments>
		<pubDate>Wed, 09 Jun 2010 21:43:51 +0000</pubDate>
		<dc:creator>udidahan</dc:creator>
				<category><![CDATA[Community]]></category>
		<category><![CDATA[ESB]]></category>
		<category><![CDATA[Messaging]]></category>
		<category><![CDATA[NServiceBus]]></category>
		<category><![CDATA[Presentations]]></category>
		<category><![CDATA[Pub/Sub]]></category>
		<category><![CDATA[SOA]]></category>

		<guid isPermaLink="false">http://www.udidahan.com/?p=1298</guid>
		<description><![CDATA[Last April I was in Bergen Norway for some consulting and training and I also gave my first NServiceBus presentation to a user group. I don&#8217;t particularly like giving NServiceBus-specific presentations, preferring to talk about the patterns and concepts of service-based architectures and service buses &#8211; NServiceBus is just an implementation. Ultimately, that&#8217;s what happened [...]]]></description>
			<content:encoded><![CDATA[<p>Last April I was in Bergen Norway for some consulting and training and I also gave my first NServiceBus presentation to a user group. I don&#8217;t particularly like giving NServiceBus-specific presentations, preferring to talk about the patterns and concepts of service-based architectures and service buses &#8211; NServiceBus is just an implementation. Ultimately, that&#8217;s what happened in the presentation &#8211; in the first half (or so) I talked about the theory, and in the second I demonstrated that theory with NServiceBus.</p>
<p>Currently, the video is being graciously hosted by Jon Torresdal on his blog, so let&#8217;s hope that the bandwidth holds up.</p>
<p>Get it <a href="http://blog.torresdal.net/2010/06/08/NNUGPresentationUdiDahanOnNServiceBus.aspx">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.udidahan.com/2010/06/09/nservicebus-presentation-now-online/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>ESB Differences Between Java and .NET</title>
		<link>http://www.udidahan.com/2010/03/29/esb-differences-between-java-and-net/</link>
		<comments>http://www.udidahan.com/2010/03/29/esb-differences-between-java-and-net/#comments</comments>
		<pubDate>Mon, 29 Mar 2010 13:53:52 +0000</pubDate>
		<dc:creator>udidahan</dc:creator>
				<category><![CDATA[BPM]]></category>
		<category><![CDATA[ESB]]></category>
		<category><![CDATA[MSMQ]]></category>
		<category><![CDATA[Messaging]]></category>
		<category><![CDATA[NServiceBus]]></category>
		<category><![CDATA[Podcast]]></category>
		<category><![CDATA[Pub/Sub]]></category>

		<guid isPermaLink="false">http://www.udidahan.com/?p=1212</guid>
		<description><![CDATA[At QCon London a couple of weeks ago I had a chat with Ross Mason, the founder of Mule &#8211; the open source Java ESB. After a while, I realized that NServiceBus is a bit different from Mule ESB in terms of scope.
While Mule has many features in terms of connectivity and integration, NServiceBus provides [...]]]></description>
			<content:encoded><![CDATA[<p>At QCon London a couple of weeks ago I had a chat with Ross Mason, the founder of <a href="http://www.mulesoft.com/mule-esb-open-source-esb">Mule &#8211; the open source Java ESB</a>. After a while, I realized that NServiceBus is a bit different from Mule ESB in terms of scope.</p>
<p>While Mule has many features in terms of connectivity and integration, NServiceBus provides platform interop only. One could say that this is a product of the different backgrounds I and Ross come from.  </p>
<p>On the other hand, the saga capabilities in NServiceBus for handling long-running processes are considered to be BPM functionality on the Java side of the industry, and as such, Mule does not have them.</p>
<p>In terms of other enterprise features like management and monitoring, Mule is more mature, but NServiceBus holds its own in terms of high availability and actually surpasses Mule with the grid and scale-out capabilities of its distributor.</p>
<p>Anyway, I think it&#8217;s about time each of these parts was explicitly described so that companies already invested in Java ESB tools will know what they&#8217;re getting with NServiceBus.</p>
<p>Until then, I hope this podcast describing the full spectrum of NServiceBus, from top level SOA services to in-the-weeds transaction management, will provide more information about what it is and why you might want to use it:</p>
<p><a href="http://deepfriedbytes.com/deepfriedbytes/podcast/episode-49-getting-the-right-message-about-nservicebus-with-udi-dahan/">Deep Fried Bytes, episode 49 &#8211; Getting the right message about NServiceBus with Udi Dahan</a>.</p>
<p>Comments most welcome.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.udidahan.com/2010/03/29/esb-differences-between-java-and-net/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>NServiceBus 2.0 RTM</title>
		<link>http://www.udidahan.com/2010/03/01/nservicebus-2-0-rtm/</link>
		<comments>http://www.udidahan.com/2010/03/01/nservicebus-2-0-rtm/#comments</comments>
		<pubDate>Tue, 02 Mar 2010 00:06:36 +0000</pubDate>
		<dc:creator>udidahan</dc:creator>
				<category><![CDATA[NServiceBus]]></category>

		<guid isPermaLink="false">http://www.udidahan.com/?p=1187</guid>
		<description><![CDATA[Well, it&#8217;s been a long time coming.
NServiceBus 2.0 RTM is now generally available.
There were some small tweaks after the RC2 but I&#8217;m happy to say that, all in all, this was a very quiet stabilization period. Key customers have reported very high levels of satisfaction with the NServiceBus stability, scalability, and simplicity.
For example
Conduit.com has very [...]]]></description>
			<content:encoded><![CDATA[<p>Well, it&#8217;s been a long time coming.</p>
<p>NServiceBus 2.0 RTM is now generally available.</p>
<p>There were some small tweaks after the RC2 but I&#8217;m happy to say that, all in all, this was a very quiet stabilization period. Key customers have reported very high levels of satisfaction with the NServiceBus stability, scalability, and simplicity.</p>
<h3>For example</h3>
<p><a href="http://www.Conduit.com">Conduit.com</a> has very happily doubled their user base with NServiceBus to 100 million.</p>
<p>#1 on American Banker&#8217;s 100 top financial tech companies, <a href="http://www.fiserv.com/">Fiserv</a> has been quietly employing NServiceBus across many of their core services.</p>
<p>The Irish SaaS company <a href="http://www.candidatemanager.net/">Candidate Manager</a> have been running the automated HR processes of geographically distributed giants like Hilton International on NServiceBus without missing a beat.</p>
<h3>Community</h3>
<p>Now with an <a href="http://tech.groups.yahoo.com/group/nservicebus/">active community</a> of over 600 members, new users are quickly brought up to speed by the veterans and the much improved <a href="http://www.nservicebus.com/Documentation.aspx">documentation</a> on the site make adopting NServiceBus simpler than ever.</p>
<p>Training on NServiceBus has also ramped up nicely with the April course in Philadelphia now sold out. The next course will be in London in May <a href="http://skillsmatter.com/course/open-source-dot-net/advanced-distributed-systems-design-with-soa/ps-314">via Skills Matter</a>.</p>
<p>More courses are being planned in:</p>
<ul>
<li><a href="http://udidahan-toronto.eventbee.com/">Toronto, Canada</a> Aug 9-13</li>
<li><a href="http://udidahan-calgary.eventbee.com/">Calgary, Canada</a> in September</li>
<li><a href="mailto:Johannesburg@UdiDahan.com">Johannesburg, South Africa</a> in October</li>
<li><a href="mailto:Sydney@UdiDahan.com">Sydney, Australia</a> in November</li>
<li><a href="mailto:Seattle@UdiDahan.com">Seattle WA, USA</a> in December</li>
</ul>
<h3>Give it a try</h3>
<p>You&#8217;ll have publish/subscribe messaging working in under 5 minutes with a simple F5 on the PubSub sample.</p>
<p><a href="http://www.NServiceBus.com">Get it here.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.udidahan.com/2010/03/01/nservicebus-2-0-rtm/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>NServiceBus 2.0 Release Candidate 2 Available</title>
		<link>http://www.udidahan.com/2010/02/01/nservicebus-2-0-release-candidate-2-available/</link>
		<comments>http://www.udidahan.com/2010/02/01/nservicebus-2-0-release-candidate-2-available/#comments</comments>
		<pubDate>Mon, 01 Feb 2010 13:13:21 +0000</pubDate>
		<dc:creator>udidahan</dc:creator>
				<category><![CDATA[ESB]]></category>
		<category><![CDATA[MSMQ]]></category>
		<category><![CDATA[Messaging]]></category>
		<category><![CDATA[NServiceBus]]></category>
		<category><![CDATA[Pub/Sub]]></category>

		<guid isPermaLink="false">http://www.udidahan.com/?p=1173</guid>
		<description><![CDATA[So it&#8217;s been about 6 months since my last NServiceBus post and since then about 1000 new people have subscribed to this blog so they might not know anything about it. For a bit of history, see the post (from almost exactly a year ago) describing the 1.9 release of NServiceBus here.
What&#8217;s New
The quickly approaching [...]]]></description>
			<content:encoded><![CDATA[<p>So it&#8217;s been about 6 months since my last NServiceBus post and since then about 1000 new people have subscribed to this blog so they might not know anything about it. For a bit of history, see the post (from almost exactly a year ago) describing the 1.9 release of NServiceBus <a href="http://www.udidahan.com/2009/02/07/nservicebus-19/">here</a>.</p>
<h2>What&#8217;s New</h2>
<p>The quickly approaching next release of NServiceBus will be version 2.0 and is a big step from 1.9. After 2 betas and 2 release candidates, this version has had a longer stabilization period than any of the versions so far (1.4-1.9). Many of my clients are already using it in production and are very pleased with it. I&#8217;ve heard similar reports from others in the community (now with over 500 members in the discussion group). There have been almost 10,000 downloads since the version 1.9 release and in every country I visit I meet people using NServiceBus in new and interesting applications.</p>
<p>With my appearance on <a href="http://www.hanselminutes.com/default.aspx?showID=194">Hanselminutes</a>, many in the mainstream .NET industry have started taking a look at NServiceBus. That, and the fact that Microsoft&#8217;s Oslo technology has now taken a very data-driven turn (rather than its original service-oriented direction).</p>
<p>Interestingly enough, I&#8217;ve been hearing more and more reports about people using NServiceBus as a developer-friendly API on top of other technologies. This includes BizTalk and even Neuron. I never thought that people would take the pluggability of NServiceBus that far.</p>
<h2>So, what is NServiceBus?</h2>
<p>Well, it&#8217;s a service bus, y&#8217;know, like an ESB &#8211; just an open-source one.</p>
<p>All kidding aside, in a nutshell, it gives you an easy way to integrate transactional messaging into your applications.</p>
<p>One of the reasons why you might want to do that is so that you don&#8217;t lose messages containing valuable data when IIS recycles your AppDomain, every 15-20 minutes (as I wrote about in <a href="http://msdn.microsoft.com/en-us/magazine/cc663023.aspx">this MSDN magazine article</a>).</p>
<p>There are many other nice things in there, like the ability to unit test your service layers and long-running processes but you can read more about that here&#8230;</p>
<h2>Documentation</h2>
<p>One of the biggest differences to NServiceBus in this release is <b>documentation</b>.</p>
<p>A lot of work has gone into the <a href="http://www.NServiceBus.com">NServiceBus.com</a> site to help developers hit the ground running with NServiceBus, including the more advanced aspects of <a href="http://www.nservicebus.com/Distributor.aspx">transparent scale-out with the distributor</a> and <a href="http://www.nservicebus.com/Gateway.aspx">multi-site communications</a>.</p>
<p>There is still work to be done in this area but feedback so far has been extremely positive (except for some grumblings from certain old-timers saying that if they could figure it out by themselves, well, you know the rest).</p>
<h2>In Closing</h2>
<p>If you&#8217;re building a distributed enterprise .NET system, take 5 minutes, download it, and see transactional publish/subscribe messaging working on your machine without any big heavy-weight middleware.</p>
<p><a href="http://www.NServiceBus.com">www.NServiceBus.com</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.udidahan.com/2010/02/01/nservicebus-2-0-release-candidate-2-available/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hanselminutes on NServiceBus</title>
		<link>http://www.udidahan.com/2009/08/21/hanselminutes-on-nservicebus/</link>
		<comments>http://www.udidahan.com/2009/08/21/hanselminutes-on-nservicebus/#comments</comments>
		<pubDate>Fri, 21 Aug 2009 19:53:11 +0000</pubDate>
		<dc:creator>udidahan</dc:creator>
				<category><![CDATA[Community]]></category>
		<category><![CDATA[ESB]]></category>
		<category><![CDATA[MSMQ]]></category>
		<category><![CDATA[Messaging]]></category>
		<category><![CDATA[NServiceBus]]></category>
		<category><![CDATA[Pub/Sub]]></category>
		<category><![CDATA[SOA]]></category>
		<category><![CDATA[WCF]]></category>

		<guid isPermaLink="false">http://www.udidahan.com/?p=1087</guid>
		<description><![CDATA[
Yesterday me and Scott virtually sat down to have a chat about NServiceBus and service buses in general. While we didn&#8217;t get in to many of the more advanced parts, you may find it an interesting introduction to the topic as well as saving yourself the costly mistake of implementing a broker instead of a [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.hanselman.com/blog/images/author.jpg" style="float:right; margin-left:10px; margin-bottom:10px;" /><br />
Yesterday me and Scott virtually sat down to have a chat about NServiceBus and service buses in general. While we didn&#8217;t get in to many of the more advanced parts, you may find it an interesting introduction to the topic as well as saving yourself the costly mistake of implementing a broker instead of a bus (yes &#8211; they&#8217;re actually two different things).</p>
<p><a href="http://www.hanselminutes.com/default.aspx?showID=194">Take a listen.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.udidahan.com/2009/08/21/hanselminutes-on-nservicebus/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Convention over Configuration &#8211; The Next Generation?</title>
		<link>http://www.udidahan.com/2009/08/15/convention-over-configuration-the-next-generation/</link>
		<comments>http://www.udidahan.com/2009/08/15/convention-over-configuration-the-next-generation/#comments</comments>
		<pubDate>Sat, 15 Aug 2009 18:13:24 +0000</pubDate>
		<dc:creator>udidahan</dc:creator>
				<category><![CDATA[Agile]]></category>
		<category><![CDATA[Architecture]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[NServiceBus]]></category>
		<category><![CDATA[Testing]]></category>

		<guid isPermaLink="false">http://www.udidahan.com/?p=1081</guid>
		<description><![CDATA[
Convention over configuration describes a style of development made popular by Ruby on Rails which has gained a great deal of traction in the .net ecosystem. After using frameworks designed in this way, I can say that the popularity is justified &#8211; it is much more pleasurable developing this way. 
The thing is, when looking [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.udidahan.com/wp-content/uploads/PicardKirk.jpg" alt="PicardKirk" title="PicardKirk" width="160" height="103" style="float:right; margin-left:10px; margin-bottom:10px; " /><br />
Convention over configuration describes a style of development made popular by Ruby on Rails which has gained a great deal of traction in the .net ecosystem. After using frameworks designed in this way, I can say that the popularity is justified &#8211; it is much more pleasurable developing this way. </p>
<p>The thing is, when looking at this in light of the full software development lifecycle, there are signs that the waters run deeper than we might have originally thought.</p>
<p>Let&#8217;s take things one step at a time though&#8230;</p>
<h3>What is it?</h3>
<p><a href="http://en.wikipedia.org/wiki/Convention_over_configuration">Wikipedia tells us</a>:</p>
<blockquote><p>&#8220;Convention over Configuration (aka Coding by convention) is a software design paradigm which seeks to decrease the number of decisions that developers need to make, gaining simplicity, but not necessarily losing flexibility. The phrase essentially means a developer only needs to specify unconventional aspects of the application.&#8221;</p></blockquote>
<p>What this means is that frameworks built in this way have default implementations that can be swapped out if needed. So far so good.</p>
<h3>For example&#8230;</h3>
<p>In <a href="http://www.NServiceBus.com">NServiceBus</a>, there is an abstraction for how subscription data is stored and multiple implementations &#8211; one in-memory, another using a durable MSMQ queue, and a third which uses a database. The convention for that part of the system is that the MSMQ implementation will be used, unless something else is specified. </p>
<p>Developers wishing to specify a different implementation can specify the desired implementation in the container &#8211; either one that comes out of the box, or their own implementation of ISubscriptionStorage.</p>
<p>Things get more interesting when we consider the full lifecycle.</p>
<h3>Lifecycle effects</h3>
<p>When developers are in the early phases of writing a new service, they want to focus primarily on what the service does &#8211; its logic. They don&#8217;t want to muck around with MSMQ queues for storing subscriptions and would much rather use the in-memory storage. </p>
<p>As the service takes shape and the developers want to run the full service on their machine, possibly testing basic fault-tolerance behaviors &#8211; kill one service, see that the others get a timeout, bring the service back up, wanting it to maintain all the previous subscriptions.</p>
<p>Moving on from there, our developers want to take the same system they just tested on their machine and move it into a staging environment. There, they don&#8217;t want to use the MSMQ implementation for subscription storage, but rather the database implementation &#8211; as will be used in the production environment. </p>
<p>While it may not sound like a big deal &#8211; changing the code which specifies which implementation to use when moving from one environment to another, consider that on top of just subscription storage, there is logging (output to console, file, db?), saga persistence (in-memory, file-based DB, relational DB), and more.</p>
<p>It&#8217;s actually quite likely that something will get missed as we move the system between environments. Can there be a better way?</p>
<h3>What if&#8230;</h3>
<p>What if there was some way for the developer to express their intent to the system, and the system could change its conventions, without the developer having to change any code or configuration files?</p>
<p>You might compare this (in concept) to debug builds and release builds. Same code, same config, but the runtime behaves different between the two.</p>
<p>As I mulled over how we could capture that intent without any code or config changes, the solution that I kept coming to seemed too trivial at first, so I dismissed it. Yet, it was the simplest one that would work for console and WinForms applications, as well as windows services &#8211; command line arguments. The only thing is that I don&#8217;t think those are available for web applications.</p>
<p>But since we&#8217;re still in &#8220;what if&#8221; land, and I&#8217;m more thinking out loud here than providing workable solutions for tomorrow morning, let&#8217;s &#8220;what if&#8221; command line arguments worked for web apps too.</p>
<h3>Command-Line Intent</h3>
<p>Going back to our original scenario, when developers are working on the logic of the service, they run it using the generic NServiceBus host process, passing it the command line parameter /lite (or whatever). The host then automatically configures all the in-memory implementations. </p>
<p>As the system progresses, when the developer wants to run everything on their machine, they run the processes with /integration. The host then configures the appropriate implementations (MSMQ for subscription storage, SQLite for saga persistence, etc. </p>
<p>When the developers want to run the system in production, they could specify /production (or maybe that could be the default?), and the database backed implementations would be configured.</p>
<h3>Imagine&#8230;</h3>
<p>Imagine being able to move that fluidly from one environment to another. Not needing to pore over configuration files or startup script code which configures a zillion implementation details. Not needing to worry that as you moved the system to staging something would break.</p>
<p>Imagine short, frictionless iterations even for large scale systems.</p>
<p>Imagine &#8211; lifecycle-aware frameworks making all this imagination a reality.</p>
<h3>In Closing</h3>
<p>We&#8217;re not there yet &#8211; but we&#8217;re not that far either. The generic host we&#8217;re providing with NServiceBus 2.0 is now being extended to support exactly these scenarios. </p>
<p>It&#8217;s my hope that as more of us think about this challenge, we&#8217;ll come up with better solutions and more intelligent frameworks. Just as convention came to our rescue before, breaking us out of the pain of endless XML configuration, I hope this new family of lifecycle-aware frameworks will make the friction of moving a system through dev, test, staging, and production a thing of the past.</p>
<p>A worthy problem for us all to solve, don&#8217;t you think?</p>
<p>Any ideas on how to make it a reality?<br />
Send them in &#8211; leave a comment below.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.udidahan.com/2009/08/15/convention-over-configuration-the-next-generation/feed/</wfw:commentRss>
		<slash:comments>29</slash:comments>
		</item>
		<item>
		<title>A Queue Isn&#8217;t An Implementation Detail</title>
		<link>http://www.udidahan.com/2009/05/25/a-queue-isnt-an-implementation-detail/</link>
		<comments>http://www.udidahan.com/2009/05/25/a-queue-isnt-an-implementation-detail/#comments</comments>
		<pubDate>Mon, 25 May 2009 18:15:01 +0000</pubDate>
		<dc:creator>udidahan</dc:creator>
				<category><![CDATA[MSMQ]]></category>
		<category><![CDATA[Messaging]]></category>
		<category><![CDATA[NServiceBus]]></category>
		<category><![CDATA[WCF]]></category>
		<category><![CDATA[Web Services]]></category>

		<guid isPermaLink="false">http://www.udidahan.com/?p=1015</guid>
		<description><![CDATA[It&#8217;s hard to believe that this continues to pop up even as WCF is reaching its fourth version (emphasis mine):
&#8220;A common complaint is that the first call on a client object takes some disproportionately large amount of time, usually ten seconds or more, while successive calls are instantaneous. There are many reasons why this might [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s hard to believe that this continues to pop up even as WCF is reaching its fourth version (emphasis mine):</p>
<blockquote><p>&#8220;A common complaint is that the first call on a client object takes some disproportionately large amount of time, <b>usually ten seconds or more</b>, while successive calls are instantaneous. There are many reasons why this might happen so <b>there&#8217;s no generic resolution for this problem</b>.&#8221; &#8212; <a href="http://blogs.msdn.com/drnick/archive/2009/05/22/tripping-over-missing-servers.aspx">Nicholas Allen</a></p></blockquote>
<p>The thing is that there <b>IS</b> a generic solution to this problem.</p>
<p>It&#8217;s queued messaging.</p>
<p>The only thing is that you have to give up talking to your services as if they were regular objects &#8211; calling methods on them and expecting a response. In other words, designing a distributed systems isn&#8217;t like designing a regular OO system just with some WCF sprinkled on top.</p>
<p>Even when trying to do fire and forget messaging on top of WCF (void method calls with the OneWay attribute), the underlying channel can still block your thread, as Nick mentioned. </p>
<p>A queue isn&#8217;t an implementation detail.<br />
It&#8217;s the primary architectural abstraction of a distributed system.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.udidahan.com/2009/05/25/a-queue-isnt-an-implementation-detail/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

