Introduction to NServiceBus                                         Daniel Marbach             Co-Founder of .NET Usergrou...
bbv Software Services AGQuick Facts• Dienstleistungsunternehmen• 150 Mitarbeitende• KMU-Strukturen – schnell, direkt, AGIL...
This is your last chance. After this, there is no turning back.You take [you name it] - the story ends, you wake up in you...
The only rule toremember
If it is   complicatedyou’re probably doing it   wrong
More reliable than regular WCF or HTTPstyle service communication                 Open-source Service     Bus Flexible pub...
Service Bus
App                       App                     Bus.dll                   Bus.dll          App                         A...
No single point of failure
Not necessarily physically separateChannels are both physical and logical
Communication is dispersed over     multiple channels
Simpler than a brokerno routing or service fail over
Get on the bus?
Reliability
[HTTP] $$ Order                               Call 1 of 3                                                DB               ...
DTC                TX Receive                             Rollback$$ Order    Q                  ESB                      ...
Throughput                    Messaging                    RPC             Load
Try    Success                       DoAnd Again                       Fail    Fail            Do Again
Publish / Subscribe
Service A                                Service BMakeCustomerPreferred()                                      Customer Ge...
Service A                                   Service B                                          Publish updated customer in...
Subscriber must be able to make decisions     based on somewhat stale data
Strong division of responsibility between          publishers and subscribers
Only one logical publisher should  be able to publish a given kind of event
Assume that messages may arrive   out of order
Function   Webservice  Class    Database
Business       Data &capability     Business RulesEverything     Nothing leftis contained   over
Explicit Boundaries            AutonomousPolicy                         Policy         Contract & Schema
Long-running process
Start Saga         Create Saga For Message Message                      Dispatch Message                                  ...
Saga Message                                   Get Saga by Message.SagaId                                  4.Return Saga  ...
Use sagas inside service boundaries
Domain Models   are Sagas
Sagas allow to model Timeouts    of your business processes
Which pill do you take?     nservicebus
Thanks for listeningSpecial thanks toUdi Dahan and NServiceBus Ltd.for supporting me                                      ...
LinksCopyright of Images        www.sxc.hu          Websites   nservicebus.com      udidahan.com  andreasohlund.net
Introduction to NServiceBus
Introduction to NServiceBus
Introduction to NServiceBus
Introduction to NServiceBus
Upcoming SlideShare
Loading in...5
×

Introduction to NServiceBus

723

Published on

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

No Downloads
Views
Total Views
723
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
0
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

Transcript of "Introduction to NServiceBus"

  1. 1. Introduction to NServiceBus Daniel Marbach Co-Founder of .NET Usergroup Zentralschweiz Co-Founder planetgeek.ch Founder of Enthusiasm Driven Development
  2. 2. bbv Software Services AGQuick Facts• Dienstleistungsunternehmen• 150 Mitarbeitende• KMU-Strukturen – schnell, direkt, AGILArbeiten in der Schweiz Permanents:• kameradschaftlicher Umgang• Hoher Verdienst, geringe Steuern• Arbeiten, wo andere Urlaub machen … Freelancer:
  3. 3. This is your last chance. After this, there is no turning back.You take [you name it] - the story ends, you wake up in your bedand believe whatever you want to believe.You take NServiceBus - you stay in Wonderlandand I show you how deep the rabbit-hole goes.
  4. 4. The only rule toremember
  5. 5. If it is complicatedyou’re probably doing it wrong
  6. 6. More reliable than regular WCF or HTTPstyle service communication Open-source Service Bus Flexible publish / subscribe Durable long-running processes
  7. 7. Service Bus
  8. 8. App App Bus.dll Bus.dll App App Bus.dll Bus.dll App App Bus.dll Bus.dllApp AppBus.dll Bus.dll
  9. 9. No single point of failure
  10. 10. Not necessarily physically separateChannels are both physical and logical
  11. 11. Communication is dispersed over multiple channels
  12. 12. Simpler than a brokerno routing or service fail over
  13. 13. Get on the bus?
  14. 14. Reliability
  15. 15. [HTTP] $$ Order Call 1 of 3 DB App Tx Call 2 of 3 Crash / Deadlock / other Where’s the order!? Rollback
  16. 16. DTC TX Receive Rollback$$ Order Q ESB Invokes Rollback Call 1 of 3 Your DB Call 2 of 3 code The order is back in the queue
  17. 17. Throughput Messaging RPC Load
  18. 18. Try Success DoAnd Again Fail Fail Do Again
  19. 19. Publish / Subscribe
  20. 20. Service A Service BMakeCustomerPreferred() Customer GetCustomerInfo() Waiting Working Return Return
  21. 21. Service A Service B Publish updated customer info Store dataMakeCustomerPreferred() Save customer as preferred Publish Customer made preferred
  22. 22. Subscriber must be able to make decisions based on somewhat stale data
  23. 23. Strong division of responsibility between publishers and subscribers
  24. 24. Only one logical publisher should be able to publish a given kind of event
  25. 25. Assume that messages may arrive out of order
  26. 26. Function Webservice Class Database
  27. 27. Business Data &capability Business RulesEverything Nothing leftis contained over
  28. 28. Explicit Boundaries AutonomousPolicy Policy Contract & Schema
  29. 29. Long-running process
  30. 30. Start Saga Create Saga For Message Message Dispatch Message Saga Bus Send Saga Messages Save Saga Saga Persister DB Persist
  31. 31. Saga Message Get Saga by Message.SagaId 4.Return Saga 2.New Dispatch Message 3.Fill Saga Bus Saga Persister Complete Saga Complete Timeouts are regular 1.Get Delete messages Can occur on multiple machines concurrently DB
  32. 32. Use sagas inside service boundaries
  33. 33. Domain Models are Sagas
  34. 34. Sagas allow to model Timeouts of your business processes
  35. 35. Which pill do you take? nservicebus
  36. 36. Thanks for listeningSpecial thanks toUdi Dahan and NServiceBus Ltd.for supporting me Daniel Marbach dotnet-zentral.ch planetgeek.ch appccelerate.com @danielmarbach
  37. 37. LinksCopyright of Images www.sxc.hu Websites nservicebus.com udidahan.com andreasohlund.net

×