Slides from my talk at WeAreDevelopers Live on the Java Day about long-running processes. Code can be found here: https://github.com/berndruecker/customer-onboarding-camunda-8-springboot
3. How does ordering Pizza work?
Pizza
Place
You
Phone Call
Synchronous blocking communication
Feedback loop (ack, confirmation or rejection)
Temporal coupling (e.g. busy, not answering)
Pizza
Place
You
Email
Asynchronous non-blocking communication
No temporal coupling
Pizza
Place
You
A feedback loop might make sense
(ack, confirmation or rejection)
Email
Confirmation Email
@berndruecker
4. Feedback loop != result
Pizza
Place
You
Email
Confirmation Email
Pizza Delivery
Feedback (ACK, confirmation, rejection)
Result
@berndruecker
5. Only the first communication step is synchronous / blocking
Pizza
Place
You
PUT/order
HTTP 200
Pizza Delivery
The task of
Pizza making is
long running
@berndruecker
11. When do services want to wait? Some business reasons…
Human work Waiting for response
Let some time pass
12. Spoiler alert: There are also
technical reasons why services
need to wait…
Please wait…
13. Why is waiting a pain?
Persistent state How to solve the technical challenges without adding accidential
complexity?
Monitoring &
Operations
Visibility
Versioning
Scheduling &
Timeouts
Domain Logic
Scalability &
Resilience
20. There are also technical reasons
why services need to wait…
21. When do services need to wait? Some technical reasons…
Asynchronous communication
Wait for
responses
Wait for
availability
Especially failure scenarios
Unavailability of peers
33. We are having some technical
difficulties and cannot present you
your boarding pass right away.
But we do actively retry ourselves, so
lean back, relax and we will send it
on time.
46. Distributed systems introduce complexity you have to tackle!
Credit
Card
Payment
REST
Cancel
charge
Using an orchestration engine allows to do long
running processes reliably, and end-to-end
53. Example
Booking Payment
If the credit
card was
rejected, the
customer can
provide new
details
Credit
Card
Retrieve
Payment
Rejected
Rejected
@berndruecker
54. Example
Booking Payment
If the credit
card was
rejected, the
customer can
provide new
details
Credit
Card
Retrieve
Payment
Rejected
Rejected
@berndruecker
A few
smart god services
tell
anemic CRUD services
what to do
Sam Newmann
55. Payment
failed
Who is responsible to deal with problems?
Booking Payment
If the credit
card was
rejected, the
customer can
provide new
details
Credit
Card
Retrieve
Payment
Rejected
Payment
received
@berndruecker
77. Recap
• You need capabilities for long running behavior for
technical and business reasons
• Process orchestration engines are a great fit
• This allows you to design better service boundaries,
implement requirements at the right places, embrace
asynchronoucity and provide a better customer experience
@berndruecker