<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Killing the Command message: should we use Events or Documents?</title><link>http://blogs.msdn.com/nickmalik/archive/2007/08/07/getting-away-from-request-and-response-soa.aspx</link><description>If we want to decouple a SOA system, we must get away from the notion of the remote procedure call. In other words, our services need to have as few "command" messages as we can get away with. This is a design philosophy but it is easier said than done.</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>re: Killing the Command message: should we use Events or Documents?</title><link>http://blogs.msdn.com/nickmalik/archive/2007/08/07/getting-away-from-request-and-response-soa.aspx#4285573</link><pubDate>Wed, 08 Aug 2007 03:48:58 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4285573</guid><dc:creator>Evan</dc:creator><description>&lt;p&gt;wow..amazing post..i'm going to have to think about this one for a while.. ;-)&lt;/p&gt;</description></item><item><title>re: Killing the Command message: should we use Events or Documents?</title><link>http://blogs.msdn.com/nickmalik/archive/2007/08/07/getting-away-from-request-and-response-soa.aspx#4287931</link><pubDate>Wed, 08 Aug 2007 08:44:15 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4287931</guid><dc:creator>Kjell-Sverre Jerijærvi</dc:creator><description>&lt;p&gt;I think your figures are a bit biased towards document messages; the event figure is almost as complicated as it gets, &amp;nbsp;while the document figure is too simplified. Even your document based solution might need to ask for more data from the publisher or other services, and the invoice service can still fail.&lt;/p&gt;
&lt;p&gt;The publisher of an event do not need to subscribe to success+failure events, it can just do what is common in workflow solutions: just start a new process (workflow) and assume that it will eventually succeed, and that there is some monitoring (BAM) and a &amp;quot;dead-letter queue&amp;quot; &amp;nbsp;that is handled to pick up on errors. The publisher only needs &amp;quot;handle external event&amp;quot; if the two autonomous, asynchronous processes needs to be joined at checkpoints. Otherwise, the sale process just asks for invoice data when naturally a part of its process. Afterall, the publisher might even not need to know that an invoice gets created - as the event message never contains any defined handling operations.&lt;/p&gt;
&lt;p&gt;Using workflow for long-running processes is a proven concept, and I like to apply this design-style to SOA systems. &lt;/p&gt;
&lt;p&gt;I think a combination of event+document is better, it removes the need for step 2 and 3 in your figure. And if you fire-and-forget the event and relies on monitoring, step 4 and 5 are also gone, at the cost of a BAM mechanism.&lt;/p&gt;</description></item><item><title>re: Killing the Command message: should we use Events or Documents?</title><link>http://blogs.msdn.com/nickmalik/archive/2007/08/07/getting-away-from-request-and-response-soa.aspx#4290393</link><pubDate>Wed, 08 Aug 2007 11:34:22 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4290393</guid><dc:creator>NickMalik</dc:creator><description>&lt;p&gt;@ Kjell-Sverre,&lt;/p&gt;
&lt;p&gt;Perhaps my document figure is missing a possible call-back, since I was aiming for a 'normal' configuration, but I did capture 100% of the requirements of a normal configuration. &amp;nbsp;&lt;/p&gt;
&lt;p&gt;I did handle the errors in the generic subscription because the error would have the same transaction id as the sale, so it would be picked up by the same rule.&lt;/p&gt;
&lt;p&gt;That said, I don't think it makes sense to eradicate events. &amp;nbsp;As I stated, events have their place, and so do command-response messages (within an application domain boundary). &amp;nbsp;I do believe, however, that document based routing is quite powerful and still simpler than typical routing scenarios based entirely on events. &amp;nbsp;&lt;/p&gt;
&lt;p&gt;Basically, it is &amp;quot;big events&amp;quot; with &amp;quot;rule based filters&amp;quot; but that doesn't sound as catchy as &amp;quot;document messaging.&amp;quot; &amp;nbsp;:-)&lt;/p&gt;
&lt;p&gt;Thanks for the feedback.&lt;/p&gt;
</description></item><item><title>re: Killing the Command message: should we use Events or Documents?</title><link>http://blogs.msdn.com/nickmalik/archive/2007/08/07/getting-away-from-request-and-response-soa.aspx#4300498</link><pubDate>Thu, 09 Aug 2007 02:56:59 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4300498</guid><dc:creator>Greg Young</dc:creator><description>&lt;p&gt;I am not convinced on the document model when dealing with other situations.&lt;/p&gt;
&lt;p&gt;Unless I am misunderstanding it, it seems like it could easily introduce odd dependencies or thoughts of doing things like &amp;quot;merging&amp;quot; of documents when dealing with parallelism. The event model with granular messages seems to be a much better fit for parallelism as its easily defined in the pi-calculus.&lt;/p&gt;
&lt;p&gt;Could you perhaps explain parallelism in a document passing based system?&lt;/p&gt;</description></item><item><title>re: Killing the Command message: should we use Events or Documents?</title><link>http://blogs.msdn.com/nickmalik/archive/2007/08/07/getting-away-from-request-and-response-soa.aspx#4306747</link><pubDate>Thu, 09 Aug 2007 11:25:39 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4306747</guid><dc:creator>Jack van Hoof</dc:creator><description>&lt;p&gt;Splendid posting, Nick. There is however one thing that I don't grasp. In my philosophy events are at the basis of documents where documents - in an ideal situation - contain a description of the full event context, including - functional - correlation identifiers like your tx identifier. So I come to &amp;quot;SaleMade&amp;quot;, &amp;quot;SaleApproved&amp;quot; and &amp;quot;SaleDenied&amp;quot; documents. Is this in contrast with your philosophy?&lt;/p&gt;
&lt;p&gt;I agree with you saying in the reply above: Basically, it is &amp;quot;big events&amp;quot; with &amp;quot;rule based filters&amp;quot; but that doesn't sound as catchy as &amp;quot;document messaging.&amp;quot; &amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thats looks a lot like my posting on loosely coupled process flows: &lt;a rel="nofollow" target="_new" href="http://soa-eda.blogspot.com/2007/06/how-to-implement-loosely-coupled.html"&gt;http://soa-eda.blogspot.com/2007/06/how-to-implement-loosely-coupled.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Jack&lt;/p&gt;</description></item><item><title>re: Killing the Command message: should we use Events or Documents?</title><link>http://blogs.msdn.com/nickmalik/archive/2007/08/07/getting-away-from-request-and-response-soa.aspx#4310595</link><pubDate>Thu, 09 Aug 2007 16:40:31 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4310595</guid><dc:creator>NickMalik</dc:creator><description>&lt;p&gt;Hi Jack,&lt;/p&gt;
&lt;p&gt;In order to do content based routing, some things have to be fairly stable. &amp;nbsp;In EDI, everything has an envelope and a header. &amp;nbsp;We inspect the envelope for addressing and the header for context of the message. &amp;nbsp;By creating three kinds of messages for SaleMade, SaleApproved, and SaleDenied, you have put the state of the sale into the header, and that is fine to a point.&lt;/p&gt;
&lt;p&gt;I did not do that because I want the receivers to create a single subscription on the document type (Sale) and have them place a rule with the routing system asking for the documents in the desired status. &amp;nbsp;Something akin to &amp;quot;Subscribe( Sale, Status: SaleMade | SaleDenied)&amp;quot;&lt;/p&gt;
&lt;p&gt;The key thing is that the &amp;quot;Routing effect&amp;quot; of both schemes is the same. &amp;nbsp;The subscriber receives ONLY the documents they want. &amp;nbsp;&lt;/p&gt;
&lt;p&gt;Having two different documents has the advantage that you can share completely different schema as the status changes. &amp;nbsp;I did not capture that effect in the described mechanism above, but it is a valuable one. &amp;nbsp;On the other hand, having one document with status allows a system to receive messages that it didn't exist when it was designed simply by changing a routing rule. &amp;nbsp;The schema of the inbound message is the same, and the receiving system can ignore the status and use other fields... like the remote system's invoice document number. &amp;nbsp;&lt;/p&gt;
&lt;p&gt;Architecturally, the exchange pattern is the same between your approach and the one I described. &amp;nbsp;It's an interesting tradeoff. &amp;nbsp;I'll have to think about what criteria I would describe for deciding between the two mechanisms. &amp;nbsp;Both are strong.&lt;/p&gt;
&lt;p&gt;Your feedback is always of very high value, Jack.&lt;/p&gt;
&lt;p&gt;--- Nick&lt;/p&gt;
</description></item><item><title>re: Killing the Command message: should we use Events or Documents?</title><link>http://blogs.msdn.com/nickmalik/archive/2007/08/07/getting-away-from-request-and-response-soa.aspx#4310608</link><pubDate>Thu, 09 Aug 2007 16:42:07 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4310608</guid><dc:creator>NickMalik</dc:creator><description>&lt;p&gt;@Greg,&lt;/p&gt;
&lt;p&gt;Pi-calculus. &amp;nbsp;Quite a challenge. &amp;nbsp;Let me stew on that for a while.&lt;/p&gt;
&lt;p&gt;--- Nick&lt;/p&gt;
</description></item><item><title>re: Killing the Command message: should we use Events or Documents?</title><link>http://blogs.msdn.com/nickmalik/archive/2007/08/07/getting-away-from-request-and-response-soa.aspx#4311326</link><pubDate>Thu, 09 Aug 2007 17:35:40 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4311326</guid><dc:creator>Jack van Hoof</dc:creator><description>&lt;p&gt;Thanks, Nick. Good stuff to think over...&lt;/p&gt;
&lt;p&gt;Jack&lt;/p&gt;</description></item><item><title>re: Killing the Command message: should we use Events or Documents?</title><link>http://blogs.msdn.com/nickmalik/archive/2007/08/07/getting-away-from-request-and-response-soa.aspx#4339811</link><pubDate>Sat, 11 Aug 2007 23:50:05 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4339811</guid><dc:creator>Rishi</dc:creator><description>&lt;p&gt;Hi Nick, &lt;/p&gt;
&lt;p&gt;Great article, keep it coming.&lt;/p&gt;
&lt;p&gt;Alright firstly the business event that says &amp;quot;create an invoice&amp;quot; is &amp;quot;bill the customer&amp;quot; and not &amp;quot;we made a sale&amp;quot;. Invoicing can be on order or pre/with/post delivery and either automated or semi-automated or manual depending on the defined business processes and the &amp;quot;we made a sale&amp;quot; is a different but related business event. &lt;/p&gt;
&lt;p&gt;Secondly, in the event driven example, I suggest that we should make the &amp;quot;invoiced&amp;quot; and &amp;quot;sale denied&amp;quot; an enumerated status of the sale - and the mechanics in play would be that both parties shown would subscribe to the change of status events, rather than each individual event. Therefore, any change of the status would be or &amp;nbsp;should be treated as a business event. Some EDA purist, would perhaps disagree with such assimilation but to me it brings flexibility and simplicity – just as you highlighted for the document based example. &amp;nbsp;In fact, in one of the system I am designing the end-user can introduce their own enumerated statu(e)s, which can be changed by any part of the related business process/workflow and in turn trigger other processes/changes. &lt;/p&gt;
&lt;p&gt;Also, I tend to think that you really have over simplified the document based approach. For example, doesn’t document based approaches bring concurrency issues? And also document based approach pushes you towards a linear execution plan, which is in contrast to event based archetypes that excel &amp;nbsp;in state-machine type interactions (and therefore more dynamic and flexible business flows). &amp;nbsp;&lt;/p&gt;
&lt;p&gt;Lastly, I see that you have put a bus type middlewear for both document and event based approaches – how much does that weigh in the bigger picture of the architecture? And the underlying implementation you recommend is pub/sub or asynchronous consumption to kill the command message? &lt;/p&gt;</description></item><item><title>re: Killing the Command message: should we use Events or Documents?</title><link>http://blogs.msdn.com/nickmalik/archive/2007/08/07/getting-away-from-request-and-response-soa.aspx#4340644</link><pubDate>Sun, 12 Aug 2007 00:58:01 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4340644</guid><dc:creator>NickMalik</dc:creator><description>&lt;p&gt;@Rishi,&lt;/p&gt;
&lt;p&gt;Wow. &amp;nbsp;I think I'll be blogging for a week to answer your questions.&lt;/p&gt;
</description></item><item><title>re: Killing the Command message: should we use Events or Documents?</title><link>http://blogs.msdn.com/nickmalik/archive/2007/08/07/getting-away-from-request-and-response-soa.aspx#4340894</link><pubDate>Sun, 12 Aug 2007 01:28:07 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4340894</guid><dc:creator>Rishi</dc:creator><description>&lt;p&gt;Like I said keep it comming.. &lt;/p&gt;</description></item><item><title>Moving BizTalk to SOA</title><link>http://blogs.msdn.com/nickmalik/archive/2007/08/07/getting-away-from-request-and-response-soa.aspx#4351063</link><pubDate>Sun, 12 Aug 2007 17:30:32 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4351063</guid><dc:creator>Connecting Systems the Microsoft Way</dc:creator><description>&lt;p&gt;Over a number of years I have been considering, cajoling, driving, arguing and mostly thinking about...&lt;/p&gt;
</description></item><item><title>re: Killing the Command message: should we use Events or Documents?</title><link>http://blogs.msdn.com/nickmalik/archive/2007/08/07/getting-away-from-request-and-response-soa.aspx#4414158</link><pubDate>Thu, 16 Aug 2007 15:14:05 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4414158</guid><dc:creator>Udi Dahan</dc:creator><description>&lt;p&gt;Just on the issue of having multiple kinds of events, using a hierarchical-topic based infrastructure, you could have systems subscribe to the top-level &amp;quot;sale&amp;quot; topic, or to the specific sub-topics: &amp;quot;sale made&amp;quot;, &amp;quot;sale approved&amp;quot;, &amp;quot;sale denied&amp;quot;.&lt;/p&gt;
&lt;p&gt;Would that change your thoughts about the event-based solution?&lt;/p&gt;
</description></item><item><title>Interesting article about SOA.</title><link>http://blogs.msdn.com/nickmalik/archive/2007/08/07/getting-away-from-request-and-response-soa.aspx#5643027</link><pubDate>Wed, 24 Oct 2007 10:17:16 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5643027</guid><dc:creator>Patrick Wellink</dc:creator><description>&lt;p&gt;Have a read of this article : Killing the Command message: should we use Events or Documents ? The second&lt;/p&gt;
</description></item><item><title>Is EDA the way to go?</title><link>http://blogs.msdn.com/nickmalik/archive/2007/08/07/getting-away-from-request-and-response-soa.aspx#9025659</link><pubDate>Fri, 31 Oct 2008 04:11:19 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9025659</guid><dc:creator>NSilverBullet</dc:creator><description>&lt;p&gt;I have been reading a lot about Event Driven Architecture (EDA) in relation t&lt;/p&gt;
</description></item></channel></rss>