Asynchronous Messaging @DNUG Cologne, 07.04.2009

699 views

Published on

A presentation by Sergey Shishkin on Asynchronous Messaging given on 07.04.2009 at .NET User Group Cologne.

Published in: Technology, Sports
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
699
On SlideShare
0
From Embeds
0
Number of Embeds
11
Actions
Shares
0
Downloads
19
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

Asynchronous Messaging @DNUG Cologne, 07.04.2009

  1. 1. Asynchronous Messaging Sergey Shishkin http:// shishkin.org Image source: http://www.flickr.com/photos/joits/1110215271/
  2. 2. Agenda Why Messaging? – And what’s wrong with good old RPC? Sample scenario – News module of the Prism’s StockTrader RI Under the hood of Message Bus – Building a Message Bus in 37 lines of code – And what those 37 lines did not cover? Image source: http://www.flickr.com/photos/mychatham/206928250/
  3. 3. Communication Styles <ul><li>Remote Procedure Calls </li></ul><ul><ul><li>Synchronous </li></ul></ul><ul><ul><li>High coupling </li></ul></ul><ul><li>One-Way Messages </li></ul><ul><ul><li>Asynchronous </li></ul></ul><ul><ul><li>Loose coupling </li></ul></ul>
  4. 4. Fallacies of Distributed Computing* * http:// en.wikipedia.org/wiki/Fallacies_of_Distributed_Computing <ul><li>The network is reliable </li></ul><ul><li>Latency is zero </li></ul><ul><li>Bandwidth is infinite </li></ul><ul><li>The network is secure </li></ul><ul><li>Topology doesn't change </li></ul><ul><li>There is one administrator </li></ul><ul><li>Transport cost is zero </li></ul><ul><li>The network is homogeneous </li></ul>Image source: http://www.flickr.com/photos/pascalcharest/308357541/
  5. 5. Composite Applications Image source: http://www.flickr.com/photos/curiouslee/2136283589/ Modularized applications are similar to distributed ones <ul><li>GUI composition is solved by: </li></ul><ul><li>Common region infrastructure </li></ul><ul><li>Event-based GUI synchronization </li></ul><ul><li>Same pattern in broader context </li></ul><ul><li>Common Message Bus infrastructure </li></ul><ul><li>Message-based components integration </li></ul>
  6. 6. Tenets of Service-Orientation* Image source: http://www.flickr.com/photos/hyper-world/2401419260/ Boundaries are explicit Services are autonomous Services share schema and contract, not class Service compatibility is based upon policy * http://msdn.microsoft.com/en-us/magazine/cc164026.aspx
  7. 7. Messaging Patterns * http://www.enterpriseintegrationpatterns.com/toc.html Message Bus is a central place for implementing integration patterns*
  8. 8. Advantages of Messaging (I) Image source: http://www.flickr.com/photos/renaissancechambara/2288556895/ Loose coupling Separation of concerns Orthogonal architecture
  9. 9. Advantages of Messaging (II) Testing Scalability
  10. 10. Disadvantages of Messaging <ul><li>Dependency tracing </li></ul><ul><li>Who is publishing that message? </li></ul><ul><li>Is publishing of that message required? </li></ul><ul><li>Debugging </li></ul><ul><li>Same as debugging of multithreaded apps </li></ul><ul><li>Learning curve </li></ul><ul><li>It’s not a new technology, it’s a paradigm shift </li></ul><ul><li>Requires different mindset and discipline </li></ul>Image source: http://www.flickr.com/photos/lwr/2257112719/
  11. 11. Guidelines <ul><li>Consider messaging to loose coupling </li></ul><ul><li>Avoid RPC across modules/business services/bounded contexts* </li></ul>* In terms of DDD Image source: http://www.flickr.com/photos/rodneytrotter/3323664794/
  12. 12. Look ahead Messaging is the default communication style for cloud-based services Silverlight does not support synchronous communication out of the box Image source: http://www.flickr.com/photos/bestrated1/2441332480/
  13. 13. DEMO
  14. 14. References <ul><li>Composite WPF guidance aka “Prism”, StockTrader RI </li></ul><ul><ul><li>http://compositewpf.codeplex.com/ </li></ul></ul><ul><li>StockTrader with messages (revision 12, as shown in demo) </li></ul><ul><ul><li>http://code.google.com/p/messagingwpf/source/browse/trunk/src/StockTraderRI/ </li></ul></ul><ul><li>Some OSS messaging frameworks </li></ul><ul><ul><li>http://code.google.com/p/masstransit/ </li></ul></ul><ul><ul><li>http://www.nservicebus.com </li></ul></ul><ul><ul><li>https://rhino-tools.svn.sourceforge.net/svnroot/rhino-tools/trunk/esb/ </li></ul></ul><ul><li>Fallacies of distributed computing </li></ul><ul><ul><li>http ://en.wikipedia.org/wiki/Fallacies_of_Distributed_Computing </li></ul></ul><ul><li>Four tenets of service orientation </li></ul><ul><ul><li>http://msdn.microsoft.com/en-us/magazine/cc164026.aspx </li></ul></ul><ul><li>Enterprise integration patterns </li></ul><ul><ul><li>http ://www.enterpriseintegrationpatterns.com/toc.html </li></ul></ul>

×