SlideShare a Scribd company logo
Let your microservices flow!
mail@bernd-ruecker.com
With thoughts from http://flowing.io
@berndruecker | @martinschimak
JCon 2017: Let your microservices flow
Simplified example:
dash button
Photo by 0xF2, available under Creative Commons BY-ND 2.0
license. https://www.flickr.com/photos/0xf2/29873149904/
Let‘s asume we go for microservices.
Because: Reasons.
Example
Checkout Payment Inventory Shipping
Let‘s zoom into the payment
public void retrievePayment(String customerId, long amount) {
long remainingAmount =
useExistingCustomerCredit(customerId, amount);
if (remainingAmount > 0) {
try {
chargeCreditCard(customerId, remainingAmount);
} catch (CreditCardExpiredException ex) {
restoreCustomerCredit(customerId, amount-remainingAmount);
throw new PaymentFailedException();
}
}
}
Let‘s zoom into the payment
public void retrievePayment(String customerId, long amount) {
long remainingAmount =
useExistingCustomerCredit(customerId, amount);
if (remainingAmount > 0) {
try {
chargeCreditCard(customerId, remainingAmount);
} catch (CreditCardExpiredException ex) {
restoreCustomerCredit(customerId, amount-remainingAmount);
throw new PaymentFailedException();
}
}
}
Remote
Service
Distributed systems
Distributed systems are hard.
You will be screwed.
But you cannot avoid it.
public void retrievePayment(String customerId, long amount) {
long remainingAmount =
useExistingCustomerCredit(customerId, amount);
if (remainingAmount > 0) {
try {
chargeCreditCard(customerId, remainingAmount);
} catch (CreditCardExpiredException ex) {
restoreCustomerCredit(customerId, amount-remainingAmount);
throw new PaymentFailedException();
}
}
}
Unreliable networks require some extra work
Circuit breaker & fail fast
Remember…
public void retrievePayment(String customerId, long amount) {
long remainingAmount =
useExistingCustomerCredit(customerId, amount);
if (remainingAmount > 0) {
try {
chargeCreditCard(customerId, remainingAmount);
} catch (CreditCardExpiredException ex) {
restoreCustomerCredit(customerId, amount-remainingAmount);
throw new PaymentFailedException();
}
}
}
Unreliable networks require some extra work
Circuit breaker & fail fast
Retry capability & async
behavior
Distributed transactions
Payment
requires
state
handling
Persist state with
Entity, Actor, …
State machine
How to
implement?
DIY
State
machine
CADENCE
Baker
Example
* Modeled in BPMN
ISO Standard for modeling and execution
Long running requires persistent state
Distributed transactions
Distributed transactions
Retrying
Timeouts and long running requirements
State machines solve some hard developer problems
Monitoring &
Operations
Handling of time &
timeouts
Retry
Visibility &
Reporting
Versioning
Compensation
Message correlation &
deduplication
Performance &
scalability
State machines
solve some hard developer problems.
Distributed systems pose some hard
problems on developers!
BPM?
JCon 2017: Let your microservices flow
JCon 2017: Let your microservices flow
A visual test report for example #1 (Balance = 50, Amount = 70)
Look for
lightweight, developer friendly
tools
Synchronous communication?
Asynchronous
Checkout Payment Inventory Shipping
Bus
Event-Driven
Checkout Payment Inventory Shipping
Bus
Order
Placed
Does not
know
recipient
Does not
know
sender
Smart endpoints
and dumb pipes
Event: Fact that
happened in the past,
Immutable fact,
0..n recepients
Order
Placed
Does know
event type…
Event-Driven – the good parts
Checkout Payment Inventory Shipping
Bus
Amount
OnStock
Changed
„The button blinks green
if we can ship the item
within 24 hours!“
End-to-end capabilities using peer-to-peer event flows?
InventoryPayment ShippingCheckout
Order
placed
Payment
received
Goods
fetched
Goods
shipped
Shipping
End-to-end capabilities using peer-to-peer event flows?
InventoryPaymentCheckout
Order
placed
Payment
received
Goods
fetched
Please fetch
the goods
before waiting
for payment
Some
customers can
pay via invoice
…
InventoryPayment ShippingCheckout
Bus
Order
Order
Placed
Retrieve
Payment
Event Command Transformation
Command: Intent,
1 recipient.
Retrieve
Payment
Fetch
Goods
Ship
Goods
Does not
know
sender
Just knows
command
type…
Commanding is important!
InventoryPayment ShippingCheckout
Bus
Ship
Goods
Order
Order
Placed
Retrieve
Payment
„A few smart god services
tell anemic CRUD services
what to do!”
Sam Newman
The problem is not orchestration!
The problem is bad API design.
Orchestration is not about synchronous
request and response.
It is a about commands
and probably long running flows.
And yes –
it can be
reactive.
Example
Example
Payment
Flows are owned by services
Order
Example
InventoryPaymentOrder ShippingCheckout Monitor
https://github.com/flowing/flowing-retail/
Human
Tasks
Messaging under control?
Photo by Andy Simmons, available under Creative Commons BY 2.0 license.
External task worker example
Stripe
Worker
Payment
Rest
Node.js Java
A possibility in your toolbox.
Pro: Easy to do, no AMQP or Kafka required for bus
Con: Coupling to Camunda API
Live hacking
Container
(e.g. Tomcat, WildFly, Websphere, …)
Architecture possibilities
Your application
Engine
DB
BPMN Java …
Your application
Engine
DB
BPMN Java …
Engine
(Docker,
Tomcat, …)
Your application
DB
Embedded engine Container managed engine Remote engine
BPMN
Java, C#,
Go, JS, …
New kid on the block
https://zeebe.io/
Zeebe
Broker
Your
application
Binary (MsgPack)
Support streaming & batching
Client
Horiziontally
scalable
Append only log / event sourcing
JCon 2017: Let your microservices flow
Distributed
systems are
hard
State machines
solve hard
developer problems
Can run
decentralized
And provide
visibility
sync and
async
Thank you!
Code:
https://github.com/berndruecker
Slides:
https://bernd-ruecker.com
Blog:
https://blog.bernd-ruecker.com
Feedback:
https://bernd-ruecker.com/feedback
With thoughts from http://flowing.io
@berndruecker | @martinschimak
Images licensed from iStock
no attribution required
Images licensed under Creative Commons license
All icons licensed from Noun Project
no attribution required
Photo by Andy Simmons, available under
Creative Commons BY 2.0 license.
https://www.flickr.com/photos/andysimmons
/4630485117/

More Related Content

PDF
O'Reilly SA: Complex event flows in distributed systems
PDF
Micronaut Webinar 2021 - Process Automation Introduction
PDF
KanDDDinsky: Let your domain events flow
PDF
JUG Frankfurt - Orchestration of microservices
PDF
Collaboration of (micro-)services
PDF
November 2017: Collaboration of (micro-)services
PDF
Jfokus 2018: Lost in transaction - Strategies to deal with (in-)consistency ...
PDF
Java User Group Erfurt 2018: Zeebe.io - Event-driven Microservice Orchestration
O'Reilly SA: Complex event flows in distributed systems
Micronaut Webinar 2021 - Process Automation Introduction
KanDDDinsky: Let your domain events flow
JUG Frankfurt - Orchestration of microservices
Collaboration of (micro-)services
November 2017: Collaboration of (micro-)services
Jfokus 2018: Lost in transaction - Strategies to deal with (in-)consistency ...
Java User Group Erfurt 2018: Zeebe.io - Event-driven Microservice Orchestration

What's hot (20)

PDF
O'Reilly SA NYC 2018: Complex event flows in distributed systems
PDF
JavaBin Trondheim and Bergen: Let your microservices flow
PDF
Complex event flows in distributed systems
PDF
GOTOpia 2020 - Balancing Choreography and Orchestration
PDF
Microservices with Camunda - Talk from Camunda Days 01/2018
PDF
The role of workflows in microservices
PDF
Process Automation Forum April 2021 - Practical Process Automation
PDF
2019 DACH Roadshow - Workflow Automation in Microservices Architectures
PDF
Camunda Con 2019 Keynote - I want my process back #microservices #serverless
PDF
Monitoring and Orchestration of your Microservices Landscape with Kafka and Z...
PDF
Camunda Day New York 2019: Workflow Automation in Microservices Architectures...
PDF
JFS 2021 - The Process Automation Map
PDF
2019 - Lost in transaction
PDF
Workflow automation with BPMN. Lessons learned.
PDF
QCon NYC 2019 - Workflow automation reinvented
PDF
Automating Processes in Modern Architectures
PDF
Serverless Days 2019 - Lost in transaction
PDF
JAX 2019 - Workflow automation reinvented
PDF
Complex event flows in distributed systems (QCon London 2019)
PPTX
Camunda Day Amsterdam 2019: Workflow Automation in Microservices Architecture...
O'Reilly SA NYC 2018: Complex event flows in distributed systems
JavaBin Trondheim and Bergen: Let your microservices flow
Complex event flows in distributed systems
GOTOpia 2020 - Balancing Choreography and Orchestration
Microservices with Camunda - Talk from Camunda Days 01/2018
The role of workflows in microservices
Process Automation Forum April 2021 - Practical Process Automation
2019 DACH Roadshow - Workflow Automation in Microservices Architectures
Camunda Con 2019 Keynote - I want my process back #microservices #serverless
Monitoring and Orchestration of your Microservices Landscape with Kafka and Z...
Camunda Day New York 2019: Workflow Automation in Microservices Architectures...
JFS 2021 - The Process Automation Map
2019 - Lost in transaction
Workflow automation with BPMN. Lessons learned.
QCon NYC 2019 - Workflow automation reinvented
Automating Processes in Modern Architectures
Serverless Days 2019 - Lost in transaction
JAX 2019 - Workflow automation reinvented
Complex event flows in distributed systems (QCon London 2019)
Camunda Day Amsterdam 2019: Workflow Automation in Microservices Architecture...
Ad

Similar to JCon 2017: Let your microservices flow (20)

PDF
Communication between (micro-)services - Bernd Rücker - Codemotion Amsterdam ...
PPT
Active Merchant
PDF
Startup Highway Workshop
PPTX
Monetizing your Applications with PayPal X Payments Platform
PPTX
Monetizing your Applications with PayPal X Payments Platform
PPT
Payment Gateway
PDF
E-commerce Payment Processing: How Does It Work?
PPT
Payment Gatway.ppt
PPT
Int Lecture 3
PPTX
Understanding the Architecture of Digital Payment Systems.pptx
PDF
Long running processes in DDD
PPT
Adaptive Payments: Changing How We Pay with PIN, Pre-approved and Split Payments
PPSX
Payments & Its Innovations
DOCX
Future-Proof Your Business_ Integrating Crypto Payments into WooCommerce
DOCX
Elevate Your E-Commerce_ Crypto Payment Gateway Solutions for WooCommerce
DOCX
Transform Your Online Store_ Accept Cryptocurrency with WooCommerce
DOCX
Unlocking Crypto_ The Ultimate Payment Gateway for WooCommerce
DOCX
Embrace the Future_ Adding Cryptocurrency Payments to Your WordPress Website
DOCX
Mastering Crypto Payments_ A WooCommerce Gateway Guide
DOCX
Step-by-Step Guide_ Adding Cryptocurrency Payments to Your WordPress Website
Communication between (micro-)services - Bernd Rücker - Codemotion Amsterdam ...
Active Merchant
Startup Highway Workshop
Monetizing your Applications with PayPal X Payments Platform
Monetizing your Applications with PayPal X Payments Platform
Payment Gateway
E-commerce Payment Processing: How Does It Work?
Payment Gatway.ppt
Int Lecture 3
Understanding the Architecture of Digital Payment Systems.pptx
Long running processes in DDD
Adaptive Payments: Changing How We Pay with PIN, Pre-approved and Split Payments
Payments & Its Innovations
Future-Proof Your Business_ Integrating Crypto Payments into WooCommerce
Elevate Your E-Commerce_ Crypto Payment Gateway Solutions for WooCommerce
Transform Your Online Store_ Accept Cryptocurrency with WooCommerce
Unlocking Crypto_ The Ultimate Payment Gateway for WooCommerce
Embrace the Future_ Adding Cryptocurrency Payments to Your WordPress Website
Mastering Crypto Payments_ A WooCommerce Gateway Guide
Step-by-Step Guide_ Adding Cryptocurrency Payments to Your WordPress Website
Ad

More from Bernd Ruecker (20)

PDF
QCon London: Mastering long-running processes in modern architectures
PDF
WeAreDevelopers Live 2024 - Mastering long-running processes in modern archit...
PDF
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...
PDF
JCon Live 2023 - Lice coding some integration problems
PDF
JFall - Process Oriented Integration
PDF
CamundaCon NYC 2023 Keynote - Shifting into overdrive with process orchestration
PDF
JavaLand 2023 - Process Oriented Integration
PDF
CraftConf: Surviving the hyperautomation low code bubbl
PDF
Mastering Data for Higher Business Impact - at Commerzbank Innovation Summit
PDF
Camunda Chapter Hamburg - Surviving the hyperautomation low code bubble
PDF
Loosely or lousily coupled - Understanding communication patterns in microser...
PDF
CamundaCon 2022 Keynote: The Process Orchestration Journey
PDF
JAX 2022 - Loosely or lousily coupled
PDF
JCon 2021 - Loosely or lousily coupled
PDF
CamundaCon 2021 Keynote :From Human Workflow to High-Throughput Process Autom...
PDF
Kafka Summit 2021 - Apache Kafka meets workflow engines
PDF
Webinar "Communication Between Loosely Coupled Microservices"
PDF
OOP 2021 - Leverage the full potential of your hipster architecture
PDF
Reactive Summit 2020 - How state helps you to stay reactive
PDF
CamundaCon 2020 Keynote - The Return of Process Automation
QCon London: Mastering long-running processes in modern architectures
WeAreDevelopers Live 2024 - Mastering long-running processes in modern archit...
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...
JCon Live 2023 - Lice coding some integration problems
JFall - Process Oriented Integration
CamundaCon NYC 2023 Keynote - Shifting into overdrive with process orchestration
JavaLand 2023 - Process Oriented Integration
CraftConf: Surviving the hyperautomation low code bubbl
Mastering Data for Higher Business Impact - at Commerzbank Innovation Summit
Camunda Chapter Hamburg - Surviving the hyperautomation low code bubble
Loosely or lousily coupled - Understanding communication patterns in microser...
CamundaCon 2022 Keynote: The Process Orchestration Journey
JAX 2022 - Loosely or lousily coupled
JCon 2021 - Loosely or lousily coupled
CamundaCon 2021 Keynote :From Human Workflow to High-Throughput Process Autom...
Kafka Summit 2021 - Apache Kafka meets workflow engines
Webinar "Communication Between Loosely Coupled Microservices"
OOP 2021 - Leverage the full potential of your hipster architecture
Reactive Summit 2020 - How state helps you to stay reactive
CamundaCon 2020 Keynote - The Return of Process Automation

Recently uploaded (20)

PDF
Univ-Connecticut-ChatGPT-Presentaion.pdf
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PPTX
SOPHOS-XG Firewall Administrator PPT.pptx
PDF
Hindi spoken digit analysis for native and non-native speakers
PDF
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
DP Operators-handbook-extract for the Mautical Institute
PDF
Enhancing emotion recognition model for a student engagement use case through...
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PDF
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
PDF
Encapsulation theory and applications.pdf
PDF
Approach and Philosophy of On baking technology
PPTX
cloud_computing_Infrastucture_as_cloud_p
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PPTX
A Presentation on Touch Screen Technology
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPTX
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PPTX
Group 1 Presentation -Planning and Decision Making .pptx
PDF
Mushroom cultivation and it's methods.pdf
Univ-Connecticut-ChatGPT-Presentaion.pdf
MIND Revenue Release Quarter 2 2025 Press Release
SOPHOS-XG Firewall Administrator PPT.pptx
Hindi spoken digit analysis for native and non-native speakers
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
Encapsulation_ Review paper, used for researhc scholars
DP Operators-handbook-extract for the Mautical Institute
Enhancing emotion recognition model for a student engagement use case through...
gpt5_lecture_notes_comprehensive_20250812015547.pdf
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
Encapsulation theory and applications.pdf
Approach and Philosophy of On baking technology
cloud_computing_Infrastucture_as_cloud_p
Assigned Numbers - 2025 - Bluetooth® Document
A Presentation on Touch Screen Technology
Agricultural_Statistics_at_a_Glance_2022_0.pdf
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Group 1 Presentation -Planning and Decision Making .pptx
Mushroom cultivation and it's methods.pdf

JCon 2017: Let your microservices flow