Presentation is loading. Please wait.

Presentation is loading. Please wait.

How to Swing a Service Bus Like You Mean It SOA with NServiceBus Jim

Similar presentations


Presentation on theme: "How to Swing a Service Bus Like You Mean It SOA with NServiceBus Jim"— Presentation transcript:

1 How to Swing a Service Bus Like You Mean It SOA with NServiceBus Jim Pelletier @pjimmy mail@thejimmyp.com

2 What is NServiceBus? Asynchronous Messaging Framework Durable messaging with MSMQ Moderately Opinionated Event Driven Autonomous Services as opposed to RPC Web Services

3 Yeah? So… What about it? SOA Provides: Freedom of design and implementation Unprecedented flexibility for growth & change Waste nearly no code on pure technical concerns SOA with Messaging VS. N-Tier with RPC

4 Outline & Disclaimer Just presenting a different possibility Mainly talking and pictures, with a little code: – Intro to Messaging with NServiceBus – Messaging Patterns – Modeling using Messages – Autonomous Services, Boundaries and Decoupling via Messaging – Architecture Overview – SOA Composite Application Demo

5 AppApp Messaging with Queues AppApp Send Queue Receive Makes for inherently asynchronous systems able to deal with spikes in load

6 TxTx AppApp Messaging with Transactional Queues TxTx AppApp Send Queue Receive Rollback Makes robust applications simple to implement Save or Update Rollback

7 TxTx AppApp Messaging with Durable Queues = Store & Forward TxTx AppApp Send Queue Receive Provides an alternative and elegant solution to availability & data loss

8 TxTx AppApp Durable Transactional Queues = Fire & Forget TxTx AppApp Send Queue Receive Which we leverage thru NServiceBus to build much simpler, more flexible and scalable solutions

9 Publisher Subscriber Subscribe Subscriber

10 Publisher Subscriber abcdefgh

11 Decisions Based on Past Events Place Order Order Service Billing Service Order Placed Customer Billed Set Max Debit For Customer Current Debt > Max Debt Customer ID Max Debt Current Balance

12 Billing Service Web UI UI Code Demo: Stock Trading Website IBM +7.56 INTC +0.34 Ordering Service Stock Ticker Service GOOG +0.34 APPL -2.3 MSFT -5.6 Place Order Customer Billed

13 Modeling with Messages Command Service Events

14 Modeling with commands & events Update Customer Customer Service Address Service Validation Service Transaction Service Customer Updated

15 Modeling with commands & events Place Order Order Service Shipping Service Billing Service Customer Care Service Order Placed Customer Notified of Order Placed Order Billed Order Shipped

16 Sales Service Polymorphism, BC’s and DDD oh my! Orders Service Handle Place Order Place Customers First Order Place Order Send Customer Catalogue & Order Forms New Lead Identified Order Accepted Handle Place Order Handle First Order Order Accepted

17 What is a service? Some code which exists exclusively as part of a service providing the sole source of a given business capability to an organization

18 What is a service? It is made up of: An Autonomous Service MVC Controllers & Views XAML & Presenters Message Handlers Business Logic Some Persistent Store No “Orchestration” code No “Management” code No Transformation code No Data Access code No Data “Munging” code No Error Handling No Unreachable code No unintended or unused code paths No code except business abstractions

19 What else is a service? Services are autonomous

20 Decoupling with a Message Schema Service A Mgs Schema A Service B Mgs Schema B Bus

21 Composed application Billing Service Order Service Pricing Service Product Catalogue Service Layout & Branding Service User Application Executable Bus NSB Host Exec(s). NSB Host Exec(s). NSB Host Exec(s). NSB Host Exec(s).

22 Code Demo – CrazyJimsSOA Composing a UI from many logically distinct components

23 Layout & Branding Service MVC Controllers HTML + JavaScript Catalogue Service MVC Controllers Pricing Service Ordering Service MVC Controllers

24 Catalogue Service MVC Controllers Pricing Service Ordering Service Layout & Branding Service MVC Controllers {JSON} + HTML + JavaScript

25 #WIN like this… Freedom of design and implementation Unprecedented flexibility for growth & change Waste nearly no code on pure technical concerns

26 Thanks & Resources Thanks to @UdiDahan checkout his ADSD course! - http://www.udidahan.com/training/#Advanced_Distributed_System_Design http://www.udidahan.com/training/#Advanced_Distributed_System_Design NServiceBus Website (Documentation & Community Sections are great) – http://www.nservicebus.com/ http://www.nservicebus.com/ Distributed Podcast - http://distributedpodcast.com/ NServiceBus Mailing List - http://tech.groups.yahoo.com/group/nservicebus/http://tech.groups.yahoo.com/group/nservicebus/ Other Mailing Lists – – http://groups.google.com/group/dddcqrs?pli=1 http://groups.google.com/group/dddcqrs?pli=1 – http://tech.groups.yahoo.com/group/service-orientated-architecture/ http://tech.groups.yahoo.com/group/service-orientated-architecture/ – http://tech.groups.yahoo.com/group/domaindrivendesign/messages http://tech.groups.yahoo.com/group/domaindrivendesign/messages

27 Questions?

28 How to Swing a Service Bus Like You Mean It SOA with NServiceBus Jim Pelletier @pjimmy mail@thejimmyp.com

29

30 AC’s, BC’s and DDD oh my! Order Service Order Processing running in NServiceBus.Host.exe Order Placement UI running in a web site

31 AC – Business Logic AC -Persistent View Model Store What is CQRS? UI Command Handlers View Model Updaters Commands Events Queries

32 Where does CQRS fit in the picture? Billing Service Order Service Pricing Service Product Service Layout & Branding Service User Application Executable Bus NSB Host Exec(s). NSB Host Exec(s). NSB Host Exec(s). NSB Host Exec(s). NSB Host Exec(s). NSB Host Exec(s). NSB Host Exec(s). NSB Host Exec(s). Commands Events Commands


Download ppt "How to Swing a Service Bus Like You Mean It SOA with NServiceBus Jim"

Similar presentations


Ads by Google