Async – message producers are non-blocking; fire-and-forget messaging; message consumers run in their own process; more complex;Decoupled – eliminates temporal coupling; enables isolated testing of services; reduces dependencies, allowing service reuse (e.g. credit card authorisation);Explicit contracts – agreement between producer/consumer; abstraction of implementationFault tolerance – durable message transports;Availability – small frequent transfers of related content (batching); load can be distributed over a wider time window;
Maximises throughput; orders are placed in a queue, correlated by name, barista can optimise processing; out-of-order deliveryError handling – write-off : discard the drink and start a fresh one; compensating action : refund money2-phase commit – wait at cashier with receipt and money on table until drink is prepared. Everything changes hands in one go, Neither cashier nor customer could leave until complete. Much simpler, but kills throughput and destroys business model, no scaleability. ESB – scales out by adding more cashiers/baristas
NServiceBus –UdiDahan; most mature Alt.Net product; 100m durable/transactional and 900m non-durable messages per hour on 3 blade centers (48 blades), 30 1U servers and 20 clusters.SimpleServiceBus – a fork of NServiceBus; designed to be more modular; health & performance monitoring baked in;ESB.NET – Keystroke IT Australia; core components are binary only, remainder is open-source
MassTransit David KeavenySenior DeveloperFairfax Digital
Enterprise Service Bus An infrastructure used for enterprise integration via a service-oriented approach: Reliable messaging; Messages exchanged between services using standard messaging patterns (e.g. request/response, publish/subscribe); Messages consist of XML data and metadata; Provides services for transforming and routing of messages
What is it?
What is it? Asynchronous Minimised coupling Explicit contract Fault tolerant Data availability
What is it? Hotto cocoa okudasai a.k.a. Starbucks Does Not Use Two-Phase Commit http://www.eaipatterns.com/ramblings/18_starbucks.html
ESB Implementations Microsoft BizTalk IBM WebSphere TIBCO BusinessWorks
MassTransit Summary Originated by Chris Patterson & Dru Sellers Lightweight Service Bus Implementation Loose coupling via publish/subscribe Active Service pattern Supports MSMQ, ActiveMQ, TIBCO EMS Open Source, Apache 2.0 License
MassTransit Architecture
Testing Individual components testable in isolation Fully unit-testable using mocks and stubs Test-first development helps improve data contract
Visualisation Tools Presents code-base logic in a visual form Aid in identifying composition problems Should be viewable on operational systems
Real-world Usage
Lessons Learned Network services are unreliable FAIL Ability to isolate services for testing WIN State-machine-based workflows WIN Under active developer FAIL/WIN
0 comments
Post a comment