SlideShare una empresa de Scribd logo
1 de 36
Descargar para leer sin conexión
d60
developing smart software solutions
                                      Ride the bus!
                                            April 2012
Mogens	
  Heller	
  Grabe	
  
            	
  
            	
  
             	
  
      mhg@d60.dk	
  
      @mookid8000	
  
 h8p://mookid.dk/oncode	
  
Agenda	
  
•  What	
  is	
  messaging	
  
•  Doing	
  it	
  with	
  NServiceBus	
  
•  Enter	
  the	
  saga	
  
What	
  is	
  messaging?	
  

void	
  CreatePresentation(string	
  name);	
  
	
  
-­‐-­‐	
  
	
  
someObject.CreatePresentation(“Ride	
  The	
  Bus!”);	
  
What	
  is	
  messaging?	
  
•  Networks	
  are	
  unreliable	
  
•  Inter-­‐process	
  communicaKon	
  is	
  dead	
  slow	
  
•  The	
  other	
  process	
  might	
  not	
  be	
  there	
  at	
  the	
  
   moment	
  
•  etc	
  
•  etc	
  
What	
  is	
  messaging?	
  
void	
  CreatePresentation(CreatePresentationArgs	
  args);	
  
	
  
-­‐-­‐	
  
	
  
var	
  args	
  =	
  new	
  CreatePresentationArgs	
  
{	
  
           	
  Title	
  =	
  “Ride	
  The	
  Bus!”	
  
};	
  
	
  
someObject.CreatePresentation(args);	
  
What	
  is	
  messaging?	
  

void	
  Process(Args	
  args);	
  
	
  
-­‐-­‐	
  
	
  
someObject.Process(new	
  CreatePresentation	
  
{	
  
           	
  Title	
  =	
  “Ride	
  The	
  Bus!”	
  
});	
  
	
  
someObject.Process(new	
  Something());	
  
	
  
someObject.Process(new	
  SomethingElse());	
  
What	
  is	
  messaging?	
  


        void	
  
InteresKng	
  properKes	
  

   •  Can	
  be	
  persisted	
  
   •  Can	
  be	
  forwarded	
  
   •  etc	
  
Persisted?	
  
MSMQ	
  can	
  do	
  that!	
  




•  Ships	
  with	
  all	
  modern	
  versions	
  of	
  Windows	
  
•  Your	
  MSMQ	
  endpoint	
  is	
  always	
  local	
  –	
  
   remoKng	
  is	
  taken	
  care	
  of	
  via	
  outgoing	
  queues	
  
•  .NET	
  client	
  in	
  System.Messaging	
  (GAC).	
  
Bus?	
  
•  Each	
  service	
  has	
  its	
  
   own	
  input	
  queue.	
  
•  When	
  a	
  service	
  needs	
  
   to	
  send	
  a	
  message,	
  
   the	
  bus	
  looks	
  up	
  the	
  
   desKnaKon	
  somehow.	
  
•  How	
  desKnaKons	
  are	
  
   looked	
  up	
  depends	
  on	
  
   whether	
  the	
  service	
  is	
  
   sending	
  or	
  publishing.	
  
Messaging	
  Pa8erns	
  
“Request/reply”	
  




        +	
  “Return	
  address”	
  	
  
+	
  maybe	
  “CorrelaKon	
  idenKfier”	
  
“Publish/subscribe”	
  
“Publish/subscribe”	
  
Request/reply	
  vs.	
  Publish/subscribe	
  
“Process	
  manager”	
  




+	
  “CorrelaKon	
  idenKfier”	
  
How	
  to	
  do	
  these	
  things	
  IRL	
  
       •  Commercial	
  
          –  NServiceBus	
  


       •  Free	
  alternaKves	
  
          –  MassTransit	
  
          –  RhinoESB	
  
          –  Rebus(*)	
  
NServiceBus	
  
•  Currently	
  in	
  version	
  3.0	
  

•  Licensing	
  
    –  <=	
  2.0	
  are	
  free	
  
    –  >=	
  2.5	
  cost	
  money	
  
Show	
  me	
  the	
  code	
  
•  Now	
  let’s	
  see	
  how	
  “Request/reply”	
  looks	
  with	
  
   NServiceBus	
  
    –  We	
  have	
  a	
  pre8y	
  unreliable	
  web	
  service,	
  umm	
  
       “Whatchamacallit”,	
  that	
  we	
  want	
  to	
  call.	
  
    –  We	
  build	
  an	
  integraKon	
  service	
  with	
  NServiceBus	
  that	
  
       works	
  as	
  a	
  messaging	
  façade	
  towards	
  the	
  web	
  service.	
  
    –  Our	
  system	
  requests	
  stuff	
  from	
  the	
  façade,	
  the	
  façade	
  
       replies.	
  
Show	
  me	
  the	
  code	
  
•  Now,	
  let’s	
  see	
  an	
  example	
  with	
  some	
  Pub/sub	
  acKon	
  
    –  We	
  have	
  a	
  service	
  that	
  processes	
  something,	
  
       “Somekindofprocessor”,	
  when	
  it	
  receives	
  a	
  
       ProcessSomething	
  command.	
  
    –  In	
  order	
  to	
  process	
  stuff,	
  it	
  needs	
  to	
  get	
  the	
  important	
  
       string	
  from	
  our	
  unreliable	
  web	
  service	
  from	
  before.	
  
    –  When	
  processing	
  is	
  done,	
  it	
  should	
  publish	
  the	
  result,	
  
       allowing	
  any	
  other	
  interested	
  services	
  to	
  react	
  to	
  this.	
  
What	
  just	
  happened?	
  
What	
  just	
  happened?	
  
The	
  real	
  world	
  is	
  a	
  place...	
  
•  ...where	
  we	
  can’t	
  always	
  process	
  messages	
  in	
  
   a	
  stateless	
  manner	
  like	
  this...	
  
•  ...where	
  mulKple	
  things	
  need	
  coordinaKon	
  
   and	
  will	
  not	
  always	
  succeed/fail	
  as	
  a	
  whole...	
  
Enter	
  the	
  saga!	
  
•  A	
  model	
  for	
  long-­‐lived	
  transacKons.	
  
•  “A	
  long-­‐lived	
  transacKon	
  is	
  a	
  saga	
  if	
  it	
  can	
  be	
  
   wri8en	
  as	
  a	
  sequence	
  of	
  transacKons	
  that	
  can	
  
   be	
  interleaved	
  with	
  other	
  transacKons.”	
  




•  For	
  some	
  reason,	
  Mike	
  Amundsen	
  keeps	
  a	
  copy	
  of	
  the	
  original	
  whitepaper	
  
   PDF	
  here:	
  h8p://www.amundsen.com/downloads/sagas.pdf	
  	
  
Sagas	
  
•  Implemented	
  with	
  an	
  implementaKon	
  of	
  
   ISagaEntity,	
  TEntity	
  and	
  deriving	
  a	
  
   message	
  handler	
  from	
  Saga<TEntity>.	
  
•  All	
  handled	
  messages	
  should	
  somehow	
  be	
  
   correlated	
  with	
  the	
  sata	
  data.	
  
Show	
  me	
  the	
  code	
  
•  Just	
  do	
  it	
  
Sagas	
  
•  Use	
  them	
  to	
  
    –  implement	
  short	
  conversaKons	
  
    –  implement	
  long	
  conversaKons	
  
    –  handle	
  Kmeouts	
  
    –  implement	
  idempotency	
  
Thanks	
  for	
  listening!	
  
        mhg@d60.dk	
  
        @mookid8000	
  
   h8p://mookid.dk/oncode	
  
Image	
  credits	
  
“It’s	
  the	
  same	
  mouth,	
  just	
  flipped”:	
  
h8p://humor-­‐image.com/its-­‐the-­‐same-­‐mouth-­‐just-­‐flipped/	
  
	
  
	
  
	
  
Thanks	
  for	
  lepng	
  me	
  borrow	
  your	
  awesome	
  images	
  –	
  if	
  you	
  ever	
  meet	
  me,	
  I’ll	
  buy	
  you	
  guys	
  and	
  girls	
  a	
  beer.	
  Seriously,	
  I	
  will.	
  

Más contenido relacionado

La actualidad más candente

WebAssembly vs JavaScript: What is faster?
WebAssembly vs JavaScript: What is faster?WebAssembly vs JavaScript: What is faster?
WebAssembly vs JavaScript: What is faster?Alexandr Skachkov
 
A web app in pure Clojure
A web app in pure ClojureA web app in pure Clojure
A web app in pure ClojureDane Schneider
 
Custom coded projects
Custom coded projectsCustom coded projects
Custom coded projectsMarko Heijnen
 
Vlad zelinschi optimizing the critical rendering path
Vlad zelinschi   optimizing the critical rendering pathVlad zelinschi   optimizing the critical rendering path
Vlad zelinschi optimizing the critical rendering pathCodecamp Romania
 
EXTREME CHATOPS USING KUBERNETES AND WATSON
EXTREME CHATOPS USING KUBERNETES AND WATSONEXTREME CHATOPS USING KUBERNETES AND WATSON
EXTREME CHATOPS USING KUBERNETES AND WATSONJeff Sloyer
 
WordPress Hosting Basics
WordPress Hosting BasicsWordPress Hosting Basics
WordPress Hosting BasicsChris Burgess
 
Surviving in a microservices environment
Surviving in a microservices environmentSurviving in a microservices environment
Surviving in a microservices environmentSteve Pember
 
Choosing your animation adventure - Generate NYC 2018
Choosing your animation adventure  - Generate NYC 2018Choosing your animation adventure  - Generate NYC 2018
Choosing your animation adventure - Generate NYC 2018Val Head
 
PAC 2019 virtual Mark Tomlinson
PAC 2019 virtual Mark TomlinsonPAC 2019 virtual Mark Tomlinson
PAC 2019 virtual Mark TomlinsonNeotys
 
Canopy view of single-page applications (SPAs)
Canopy view of single-page applications (SPAs)Canopy view of single-page applications (SPAs)
Canopy view of single-page applications (SPAs)Benjamin Howarth
 
Saigon Ruby Meetup 06/10/2015 - Changeful Gem
Saigon Ruby Meetup 06/10/2015 - Changeful GemSaigon Ruby Meetup 06/10/2015 - Changeful Gem
Saigon Ruby Meetup 06/10/2015 - Changeful GemFutureworkz
 
Untangling - fall2017 - week 7
Untangling - fall2017 - week 7Untangling - fall2017 - week 7
Untangling - fall2017 - week 7Derek Jacoby
 
Why use Go for web development?
Why use Go for web development?Why use Go for web development?
Why use Go for web development?Weng Wei
 
Cloud fail scaling to infinity but not beyond
Cloud fail   scaling to infinity but not beyondCloud fail   scaling to infinity but not beyond
Cloud fail scaling to infinity but not beyondKunal Johar
 
Use all the buzzwords
Use all the buzzwordsUse all the buzzwords
Use all the buzzwordsJared Faris
 
Webkit Transitions. The Good, The Bad, & The Awesome
Webkit Transitions. The Good, The Bad, & The AwesomeWebkit Transitions. The Good, The Bad, & The Awesome
Webkit Transitions. The Good, The Bad, & The Awesomedavatron5000
 
Fast Web Applications with Go
Fast Web Applications with Go Fast Web Applications with Go
Fast Web Applications with Go Eylem Ozekin
 
Extreme Javascript Minification
Extreme Javascript MinificationExtreme Javascript Minification
Extreme Javascript MinificationDavid Goemans
 
Smooth Animations for Web & Hybrid
Smooth Animations for Web & HybridSmooth Animations for Web & Hybrid
Smooth Animations for Web & HybridFITC
 

La actualidad más candente (19)

WebAssembly vs JavaScript: What is faster?
WebAssembly vs JavaScript: What is faster?WebAssembly vs JavaScript: What is faster?
WebAssembly vs JavaScript: What is faster?
 
A web app in pure Clojure
A web app in pure ClojureA web app in pure Clojure
A web app in pure Clojure
 
Custom coded projects
Custom coded projectsCustom coded projects
Custom coded projects
 
Vlad zelinschi optimizing the critical rendering path
Vlad zelinschi   optimizing the critical rendering pathVlad zelinschi   optimizing the critical rendering path
Vlad zelinschi optimizing the critical rendering path
 
EXTREME CHATOPS USING KUBERNETES AND WATSON
EXTREME CHATOPS USING KUBERNETES AND WATSONEXTREME CHATOPS USING KUBERNETES AND WATSON
EXTREME CHATOPS USING KUBERNETES AND WATSON
 
WordPress Hosting Basics
WordPress Hosting BasicsWordPress Hosting Basics
WordPress Hosting Basics
 
Surviving in a microservices environment
Surviving in a microservices environmentSurviving in a microservices environment
Surviving in a microservices environment
 
Choosing your animation adventure - Generate NYC 2018
Choosing your animation adventure  - Generate NYC 2018Choosing your animation adventure  - Generate NYC 2018
Choosing your animation adventure - Generate NYC 2018
 
PAC 2019 virtual Mark Tomlinson
PAC 2019 virtual Mark TomlinsonPAC 2019 virtual Mark Tomlinson
PAC 2019 virtual Mark Tomlinson
 
Canopy view of single-page applications (SPAs)
Canopy view of single-page applications (SPAs)Canopy view of single-page applications (SPAs)
Canopy view of single-page applications (SPAs)
 
Saigon Ruby Meetup 06/10/2015 - Changeful Gem
Saigon Ruby Meetup 06/10/2015 - Changeful GemSaigon Ruby Meetup 06/10/2015 - Changeful Gem
Saigon Ruby Meetup 06/10/2015 - Changeful Gem
 
Untangling - fall2017 - week 7
Untangling - fall2017 - week 7Untangling - fall2017 - week 7
Untangling - fall2017 - week 7
 
Why use Go for web development?
Why use Go for web development?Why use Go for web development?
Why use Go for web development?
 
Cloud fail scaling to infinity but not beyond
Cloud fail   scaling to infinity but not beyondCloud fail   scaling to infinity but not beyond
Cloud fail scaling to infinity but not beyond
 
Use all the buzzwords
Use all the buzzwordsUse all the buzzwords
Use all the buzzwords
 
Webkit Transitions. The Good, The Bad, & The Awesome
Webkit Transitions. The Good, The Bad, & The AwesomeWebkit Transitions. The Good, The Bad, & The Awesome
Webkit Transitions. The Good, The Bad, & The Awesome
 
Fast Web Applications with Go
Fast Web Applications with Go Fast Web Applications with Go
Fast Web Applications with Go
 
Extreme Javascript Minification
Extreme Javascript MinificationExtreme Javascript Minification
Extreme Javascript Minification
 
Smooth Animations for Web & Hybrid
Smooth Animations for Web & HybridSmooth Animations for Web & Hybrid
Smooth Animations for Web & Hybrid
 

Similar a Ride The Bus!

Using Apache Camel as AKKA
Using Apache Camel as AKKAUsing Apache Camel as AKKA
Using Apache Camel as AKKAJohan Edstrom
 
Building Asynchronous Applications
Building Asynchronous ApplicationsBuilding Asynchronous Applications
Building Asynchronous ApplicationsJohan Edstrom
 
Web Development using Ruby on Rails
Web Development using Ruby on RailsWeb Development using Ruby on Rails
Web Development using Ruby on RailsAvi Kedar
 
Node.JS| Coffeescript Presentation
Node.JS| Coffeescript PresentationNode.JS| Coffeescript Presentation
Node.JS| Coffeescript PresentationSam Frons
 
Messaging, interoperability and log aggregation - a new framework
Messaging, interoperability and log aggregation - a new frameworkMessaging, interoperability and log aggregation - a new framework
Messaging, interoperability and log aggregation - a new frameworkTomas Doran
 
Real time system_performance_mon
Real time system_performance_monReal time system_performance_mon
Real time system_performance_monTomas Doran
 
Cloud: From Unmanned Data Center to Algorithmic Economy using Openstack
Cloud: From Unmanned Data Center to Algorithmic Economy using OpenstackCloud: From Unmanned Data Center to Algorithmic Economy using Openstack
Cloud: From Unmanned Data Center to Algorithmic Economy using OpenstackAndrew Yongjoon Kong
 
IBM and Node.js - Old Doge, New Tricks
IBM and Node.js - Old Doge, New TricksIBM and Node.js - Old Doge, New Tricks
IBM and Node.js - Old Doge, New TricksDejan Glozic
 
Life in a Queue - Using Message Queue with django
Life in a Queue - Using Message Queue with djangoLife in a Queue - Using Message Queue with django
Life in a Queue - Using Message Queue with djangoTareque Hossain
 
Usersnap and the javascript magic behind the scenes - ViennaJS
Usersnap and the javascript magic behind the scenes - ViennaJSUsersnap and the javascript magic behind the scenes - ViennaJS
Usersnap and the javascript magic behind the scenes - ViennaJSUsersnap
 
Joyent circa 2006 (Scale with Rails)
Joyent circa 2006 (Scale with Rails)Joyent circa 2006 (Scale with Rails)
Joyent circa 2006 (Scale with Rails)bcantrill
 
Dapper: the microORM that will change your life
Dapper: the microORM that will change your lifeDapper: the microORM that will change your life
Dapper: the microORM that will change your lifeDavide Mauri
 
Succeding with the Apache SOA stack
Succeding with the Apache SOA stackSucceding with the Apache SOA stack
Succeding with the Apache SOA stackJohan Edstrom
 
Performance and scalability with drupal
Performance and scalability with drupalPerformance and scalability with drupal
Performance and scalability with drupalRonan Berder
 
2019-10-15 - the future of cloud-native Java - Bert Ertman
2019-10-15 - the future of cloud-native Java - Bert Ertman2019-10-15 - the future of cloud-native Java - Bert Ertman
2019-10-15 - the future of cloud-native Java - Bert ErtmanApeldoorn JUG
 
Cloud Native (Bert Ertman)
Cloud Native (Bert Ertman)Cloud Native (Bert Ertman)
Cloud Native (Bert Ertman)Anton de Ruiter
 
IWMW 2002: Portals and CMS:" Why You Need Them Both
IWMW 2002: Portals and CMS:" Why You Need Them BothIWMW 2002: Portals and CMS:" Why You Need Them Both
IWMW 2002: Portals and CMS:" Why You Need Them BothIWMW
 

Similar a Ride The Bus! (20)

Using Apache Camel as AKKA
Using Apache Camel as AKKAUsing Apache Camel as AKKA
Using Apache Camel as AKKA
 
Building Asynchronous Applications
Building Asynchronous ApplicationsBuilding Asynchronous Applications
Building Asynchronous Applications
 
Web Development using Ruby on Rails
Web Development using Ruby on RailsWeb Development using Ruby on Rails
Web Development using Ruby on Rails
 
Node.JS| Coffeescript Presentation
Node.JS| Coffeescript PresentationNode.JS| Coffeescript Presentation
Node.JS| Coffeescript Presentation
 
Stackato v3
Stackato v3Stackato v3
Stackato v3
 
Messaging, interoperability and log aggregation - a new framework
Messaging, interoperability and log aggregation - a new frameworkMessaging, interoperability and log aggregation - a new framework
Messaging, interoperability and log aggregation - a new framework
 
Real time system_performance_mon
Real time system_performance_monReal time system_performance_mon
Real time system_performance_mon
 
Cloud: From Unmanned Data Center to Algorithmic Economy using Openstack
Cloud: From Unmanned Data Center to Algorithmic Economy using OpenstackCloud: From Unmanned Data Center to Algorithmic Economy using Openstack
Cloud: From Unmanned Data Center to Algorithmic Economy using Openstack
 
IBM and Node.js - Old Doge, New Tricks
IBM and Node.js - Old Doge, New TricksIBM and Node.js - Old Doge, New Tricks
IBM and Node.js - Old Doge, New Tricks
 
Life in a Queue - Using Message Queue with django
Life in a Queue - Using Message Queue with djangoLife in a Queue - Using Message Queue with django
Life in a Queue - Using Message Queue with django
 
Usersnap and the javascript magic behind the scenes - ViennaJS
Usersnap and the javascript magic behind the scenes - ViennaJSUsersnap and the javascript magic behind the scenes - ViennaJS
Usersnap and the javascript magic behind the scenes - ViennaJS
 
Stackato v5
Stackato v5Stackato v5
Stackato v5
 
Joyent circa 2006 (Scale with Rails)
Joyent circa 2006 (Scale with Rails)Joyent circa 2006 (Scale with Rails)
Joyent circa 2006 (Scale with Rails)
 
Dapper: the microORM that will change your life
Dapper: the microORM that will change your lifeDapper: the microORM that will change your life
Dapper: the microORM that will change your life
 
Succeding with the Apache SOA stack
Succeding with the Apache SOA stackSucceding with the Apache SOA stack
Succeding with the Apache SOA stack
 
Stackato v2
Stackato v2Stackato v2
Stackato v2
 
Performance and scalability with drupal
Performance and scalability with drupalPerformance and scalability with drupal
Performance and scalability with drupal
 
2019-10-15 - the future of cloud-native Java - Bert Ertman
2019-10-15 - the future of cloud-native Java - Bert Ertman2019-10-15 - the future of cloud-native Java - Bert Ertman
2019-10-15 - the future of cloud-native Java - Bert Ertman
 
Cloud Native (Bert Ertman)
Cloud Native (Bert Ertman)Cloud Native (Bert Ertman)
Cloud Native (Bert Ertman)
 
IWMW 2002: Portals and CMS:" Why You Need Them Both
IWMW 2002: Portals and CMS:" Why You Need Them BothIWMW 2002: Portals and CMS:" Why You Need Them Both
IWMW 2002: Portals and CMS:" Why You Need Them Both
 

Último

Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 

Último (20)

Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 

Ride The Bus!

  • 1. d60 developing smart software solutions Ride the bus! April 2012
  • 2. Mogens  Heller  Grabe         mhg@d60.dk   @mookid8000   h8p://mookid.dk/oncode  
  • 3. Agenda   •  What  is  messaging   •  Doing  it  with  NServiceBus   •  Enter  the  saga  
  • 4. What  is  messaging?   void  CreatePresentation(string  name);     -­‐-­‐     someObject.CreatePresentation(“Ride  The  Bus!”);  
  • 5. What  is  messaging?   •  Networks  are  unreliable   •  Inter-­‐process  communicaKon  is  dead  slow   •  The  other  process  might  not  be  there  at  the   moment   •  etc   •  etc  
  • 6. What  is  messaging?   void  CreatePresentation(CreatePresentationArgs  args);     -­‐-­‐     var  args  =  new  CreatePresentationArgs   {    Title  =  “Ride  The  Bus!”   };     someObject.CreatePresentation(args);  
  • 7. What  is  messaging?   void  Process(Args  args);     -­‐-­‐     someObject.Process(new  CreatePresentation   {    Title  =  “Ride  The  Bus!”   });     someObject.Process(new  Something());     someObject.Process(new  SomethingElse());  
  • 9. InteresKng  properKes   •  Can  be  persisted   •  Can  be  forwarded   •  etc  
  • 11. MSMQ  can  do  that!   •  Ships  with  all  modern  versions  of  Windows   •  Your  MSMQ  endpoint  is  always  local  –   remoKng  is  taken  care  of  via  outgoing  queues   •  .NET  client  in  System.Messaging  (GAC).  
  • 13.
  • 14.
  • 15. •  Each  service  has  its   own  input  queue.   •  When  a  service  needs   to  send  a  message,   the  bus  looks  up  the   desKnaKon  somehow.   •  How  desKnaKons  are   looked  up  depends  on   whether  the  service  is   sending  or  publishing.  
  • 16.
  • 18. “Request/reply”   +  “Return  address”     +  maybe  “CorrelaKon  idenKfier”  
  • 22.
  • 23. “Process  manager”   +  “CorrelaKon  idenKfier”  
  • 24. How  to  do  these  things  IRL   •  Commercial   –  NServiceBus   •  Free  alternaKves   –  MassTransit   –  RhinoESB   –  Rebus(*)  
  • 25. NServiceBus   •  Currently  in  version  3.0   •  Licensing   –  <=  2.0  are  free   –  >=  2.5  cost  money  
  • 26. Show  me  the  code   •  Now  let’s  see  how  “Request/reply”  looks  with   NServiceBus   –  We  have  a  pre8y  unreliable  web  service,  umm   “Whatchamacallit”,  that  we  want  to  call.   –  We  build  an  integraKon  service  with  NServiceBus  that   works  as  a  messaging  façade  towards  the  web  service.   –  Our  system  requests  stuff  from  the  façade,  the  façade   replies.  
  • 27. Show  me  the  code   •  Now,  let’s  see  an  example  with  some  Pub/sub  acKon   –  We  have  a  service  that  processes  something,   “Somekindofprocessor”,  when  it  receives  a   ProcessSomething  command.   –  In  order  to  process  stuff,  it  needs  to  get  the  important   string  from  our  unreliable  web  service  from  before.   –  When  processing  is  done,  it  should  publish  the  result,   allowing  any  other  interested  services  to  react  to  this.  
  • 30. The  real  world  is  a  place...   •  ...where  we  can’t  always  process  messages  in   a  stateless  manner  like  this...   •  ...where  mulKple  things  need  coordinaKon   and  will  not  always  succeed/fail  as  a  whole...  
  • 31. Enter  the  saga!   •  A  model  for  long-­‐lived  transacKons.   •  “A  long-­‐lived  transacKon  is  a  saga  if  it  can  be   wri8en  as  a  sequence  of  transacKons  that  can   be  interleaved  with  other  transacKons.”   •  For  some  reason,  Mike  Amundsen  keeps  a  copy  of  the  original  whitepaper   PDF  here:  h8p://www.amundsen.com/downloads/sagas.pdf    
  • 32. Sagas   •  Implemented  with  an  implementaKon  of   ISagaEntity,  TEntity  and  deriving  a   message  handler  from  Saga<TEntity>.   •  All  handled  messages  should  somehow  be   correlated  with  the  sata  data.  
  • 33. Show  me  the  code   •  Just  do  it  
  • 34. Sagas   •  Use  them  to   –  implement  short  conversaKons   –  implement  long  conversaKons   –  handle  Kmeouts   –  implement  idempotency  
  • 35. Thanks  for  listening!   mhg@d60.dk   @mookid8000   h8p://mookid.dk/oncode  
  • 36. Image  credits   “It’s  the  same  mouth,  just  flipped”:   h8p://humor-­‐image.com/its-­‐the-­‐same-­‐mouth-­‐just-­‐flipped/         Thanks  for  lepng  me  borrow  your  awesome  images  –  if  you  ever  meet  me,  I’ll  buy  you  guys  and  girls  a  beer.  Seriously,  I  will.