270 likes | 521 Views
Enterprise Integration with MassTransit. Mike Hadlow http://mikehadlow.blogspot.com mikehadlow@gmail.com Twitter: mikehadlow. What I’m going to talk about. How we do application integration Introduce event driven architecture MassTransit. Why do application integration?. Re-keying
E N D
Enterprise Integration with MassTransit Mike Hadlow http://mikehadlow.blogspot.com mikehadlow@gmail.com Twitter: mikehadlow
What I’m going to talk about • How we do application integration • Introduce event driven architecture • MassTransit
Why do application integration? • Re-keying • Multiple data silos • Lost, inconsistent information A B
Shared Database • Many applications sharing a single schema • Schema not owned by application • Schema change becomes a point of pain A B Database
File Transfer • Extract – Transform – Load (ETL) • Asynchronous • You have to build it all yourself A B File
RPC • Synchronous • Services must be available at invocation • Nested call stacks are fragile • Vendor lock-in • Fallacies of RPC • Applications do not go down • The network is always available • Latency is not a problem
Web Services • Standards based • Explicit contract (WSDL) • But it’s still RPC A B
Messaging • Store and forward A B Send Receive
Asynchronous • Message producers are non-blocking • Fire and forget • Message consumers run in their own process • Introduces a more complex programming model
Minimized Coupling • Eliminates temporal coupling • Services can be tested independently • Reduces dependencies, increasing service reuse
Explicit contract • Agreement of producer and consumer • Internal data structure remains private • Integration points remain at application’s edge • Eliminates propagation of internal changes
Fault Tolerance • Recoverable • Durable message transports
Data Availability • Enables small, frequent transfers • Distribute system load over a wider time window
Event Driven Architecture • A method of building enterprise system in which events flow between decoupled components and services • Service Oriented Architecture • Components assembled at run-time • Asynchronous programming model • Reactive behaviour
Autonomous Components • Defined by responsibility • Independent • Self-governing – makes decisions on how to react • Self-controlling – responsible for execution context • Self-contained – not part of an application
Event Producers • Publish events • Oblivious to consumer reactions • Unaffected by high number of consumers
Event Consumers • React to events • Subscribe by topic/type/selector • Asynchronous operation
Commands • Tell a component or service to do something • Initiated by an event, interaction, etc. • Use correlation for tracing, idempotence • Sent using messaging (not published)
Events • A complete representation of a specific event • Time relevant, not time sensitive • Avoid references to internal data • Reduces dependencies, loosens coupling • Each event should have its own unique identifier • Multiple component can subscribe to the same event
MassTransit • Created by • Chris Patterson • Dru Sellers • Layers a service bus on top of one-way store-and-forward messaging • MSMQ, ActiveMQ, TIBCO EMS • Open Source