#javazone
Transactions in your micro-
services architecture
Dawn Parzych (CatchPoint)
#javazone
What ?
• Transaction and Micro-Services
• MicroProfile LRA (Long Running Actions)
• Demo
Rudy De Busscher
• Payara
• Service team
• Involved in
• Committer of MicroProfile
• Committer in Eclipse EE4J groups
• Java EE Security API Expert group member
@rdebusscher
https://blog.payara.fish/
https://www.atbash.be
#javazone
Transaction
• Typical concept from the ‘Monolith’
• Start - End
• Typical short - to avoid locks
• Multiple datasources supported with XA transactions
#javazone
Transaction
• Distributed - XA transactions
• 2 Phase Commit
• Not scalable
• Locks
DZone - XA transactions
fizalihsan - Transactions
#javazone
To be ACID or Not
• Atomicity: All or Nothing
• Consistency: All values are aligned
• Isolation: Different transactions can’t see ‘temporal’ values
• Durable: Reliably Stored
• CAP Theorem
• Consistency - Availability - Partitioning
#javazone
Long Running Transactions
• Multiple Datasource
• Several steps over long period
• Single Unit of Work?
Web Services Journal
#javazone
Example
• Book Flight
• Book Hotel
• Payment
AltexSoft
#javazone
MicroService world
• No Atomicity
• Eventual Consistency
• No Isolation
• Durable
KumuluzEE
#javazone
Saga Pattern
#javazone
• Optimizing Enterprise Java

for a Micro-services Architecture
• Based on some Java EE (Jakarta EE) specs
#javazone
• First release candidate available
• API more or less stable
MP Long Running Action
#javazone
MicroProfile LRA
• Long Running Actions
• Features
• Loose coupling
• Guaranteed a globally consistent outcome
• Compensatable actions (SAGAs)
#javazone
LRA Components
JAX-RS
resource
JAX-RS
resource
JAX-RS
resource
Coordinator
Participant Participant Participant
Callback
Enlist
Demo
#javazone
Some Key code concepts
• @LRA
• LRA Level / defines transaction
• @Compensate
• Participant level: Not present, not a participant.
• @Complete
• Participant level
• LRA ID ( = URI)
• Uniquely defines the Long Running Action (transaction)
• Propagated through Header
#javazone
LRA Types
• Required for each JAX-RS resource
Active LRA No LRA
Required Use Active Start New
Requires New Start New Start New
Mandatory Use Active Error
Supports Propagate -
Never Error -
Not Supported Not propagated -
Participant
Not listed: type Nested
Demo
Service A
Service B
Service C
Start
End
Distributed
#javazone
Returning Participant Status
• Immediate
• Return type ParticipantStatus, void
• Asynchronous return
• Return CompletableFuture<ParticipantStatus>
• Idempotent @Complete/@Compensate
• Return type ParticipantStatus
• ParticipantStatus.Completing / ParticipantStatus.Compensating
• Through @Status method
• First call to @Complete/@Compensate
• Following calls to @Status
#javazone
TimeOut
• By Default, LRA runs forever
• But also by Default, immediately closed
• Closed explicitly (end=true)
• Define a timeout -> cancelled / all participants compensated.
#javazone
Remove Participant
• @Leave
• Remove Participant from LRA
• Developer responsible for cleanup
• No @Compensate/@Complete/@Status called
#javazone
Feedback final status
• @AfterLRA
• What was the final outcome
• For participants
• For ‘parties’
• Can be used for any @LRA, not @Compensate annotated class.
#javazone
Store LRA Info
• LRA only performs orchestration
• Participant needs to keep track of LRA
• Store LRA Id as part of your business data
• Extension
• LRAData
• ParticipantData
#javazone
Takeaways
• Classic approach for Transactions and Long Running Action not
applicable for micro-services
• MicroProfile LRA uses Compensatable actions
• Loosely coupled on top of JAX-RS resources
• Specification : In progress
#javazone
Code
• Project https://github.com/eclipse/microprofile-lra
• Demo code
• https://github.com/rdebusscher/mp-lra-demo
#javazone
Thank You
Not using the Payara Platform yet? Download the open
source software: Payara Server or Payara Micro
https://payara.fish/downloads


Need support for the Payara Platform?
https://payara.fish/support

More Related Content

PDF
Control and monitor_microservices_with_microprofile
PPTX
A Deeper Look Into Reactive Streams with Akka Streams 1.0 and Slick 3.0
PDF
Monitor Micro-service with MicroProfile metrics
PDF
URP? Excuse You! The Three Metrics You Have to Know
PDF
The 6 Rules for Modernizing Your Legacy Java Monolith with Microservices
PDF
Advanced queries on the Infinispan Data Grid
PPTX
Hands-on Performance Tuning Lab - Devoxx Poland
PPTX
Lightbend Training for Scala, Akka, Play Framework and Apache Spark
Control and monitor_microservices_with_microprofile
A Deeper Look Into Reactive Streams with Akka Streams 1.0 and Slick 3.0
Monitor Micro-service with MicroProfile metrics
URP? Excuse You! The Three Metrics You Have to Know
The 6 Rules for Modernizing Your Legacy Java Monolith with Microservices
Advanced queries on the Infinispan Data Grid
Hands-on Performance Tuning Lab - Devoxx Poland
Lightbend Training for Scala, Akka, Play Framework and Apache Spark

What's hot (18)

PDF
Effective cloud-ready apps with MicroProfile
PPTX
JakartaOne Livestream CN4J: Eclipse MicroProfile - Your Cloud-Native Companion
PDF
Secure JAX-RS
PPTX
Typesafe Reactive Platform: Monitoring 1.0, Commercial features and more
PDF
Machine Learning At Speed: Operationalizing ML For Real-Time Data Streams
PPTX
Debugging Microservices - key challenges and techniques - Microservices Odesa...
PDF
Making Scala Faster: 3 Expert Tips For Busy Development Teams
PPT
Sneaking Scala through the Back Door
PPTX
Monitoring Oracle SOA Suite
PDF
Apache Kafka® Delivers a Single Source of Truth for The New York Times
PDF
Pakk Your Alpakka: Reactive Streams Integrations For AWS, Azure, & Google Cloud
PDF
Better Deployments with Sub Environments Using Spring Cloud and Netflix Ribbon
PPTX
Microservices and Integration: what's next with Istio service mesh
PDF
Akka at Enterprise Scale: Performance Tuning Distributed Applications
PPTX
Monitoring Oracle SOA Suite - UKOUG Tech15 2015
PDF
Gradual migration to MicroProfile
PDF
Introduction to Micronaut - JBCNConf 2019
Effective cloud-ready apps with MicroProfile
JakartaOne Livestream CN4J: Eclipse MicroProfile - Your Cloud-Native Companion
Secure JAX-RS
Typesafe Reactive Platform: Monitoring 1.0, Commercial features and more
Machine Learning At Speed: Operationalizing ML For Real-Time Data Streams
Debugging Microservices - key challenges and techniques - Microservices Odesa...
Making Scala Faster: 3 Expert Tips For Busy Development Teams
Sneaking Scala through the Back Door
Monitoring Oracle SOA Suite
Apache Kafka® Delivers a Single Source of Truth for The New York Times
Pakk Your Alpakka: Reactive Streams Integrations For AWS, Azure, & Google Cloud
Better Deployments with Sub Environments Using Spring Cloud and Netflix Ribbon
Microservices and Integration: what's next with Istio service mesh
Akka at Enterprise Scale: Performance Tuning Distributed Applications
Monitoring Oracle SOA Suite - UKOUG Tech15 2015
Gradual migration to MicroProfile
Introduction to Micronaut - JBCNConf 2019
Ad

Similar to Transactions in micro-services (fall 2019) (7)

PDF
Transactions in micro-services (summer 2019)
PDF
Transactions in Microservices
PDF
A Distributed Transaction Model for Read-Write Linked Data Applications
PPT
Session 9 Tp9
PDF
Lagom : Reactive microservice framework
PPT
05 Transactions
PPTX
Going Reactive with Relational Databases
Transactions in micro-services (summer 2019)
Transactions in Microservices
A Distributed Transaction Model for Read-Write Linked Data Applications
Session 9 Tp9
Lagom : Reactive microservice framework
05 Transactions
Going Reactive with Relational Databases
Ad

More from Rudy De Busscher (14)

PDF
jakarta-integration-testing.pdf
PDF
core-profile_jakartaOne2022.pdf
PDF
MicroStream-WithoutDatabase.pdf
PDF
Jakarta EE 8 on JDK17
PDF
How Class Data Sharing Can Speed up Your Jakarta EE Application Startup
PDF
Creating a Kubernetes Operator in Java
PDF
Finally, easy integration testing with Testcontainers
PDF
Secure JAX-RS
PDF
From Monolith to micro-services and back : The Self Contained Systems
PDF
Java EE Security API - JSR375: Getting Started
PDF
What is tackled in the Java EE Security API (Java EE 8)
PPTX
Java ee 8 + security overview
PPTX
Extending Arquillian graphene
PPTX
Octopus framework; Permission based security framework for Java EE
jakarta-integration-testing.pdf
core-profile_jakartaOne2022.pdf
MicroStream-WithoutDatabase.pdf
Jakarta EE 8 on JDK17
How Class Data Sharing Can Speed up Your Jakarta EE Application Startup
Creating a Kubernetes Operator in Java
Finally, easy integration testing with Testcontainers
Secure JAX-RS
From Monolith to micro-services and back : The Self Contained Systems
Java EE Security API - JSR375: Getting Started
What is tackled in the Java EE Security API (Java EE 8)
Java ee 8 + security overview
Extending Arquillian graphene
Octopus framework; Permission based security framework for Java EE

Recently uploaded (20)

PDF
Website Design & Development_ Professional Web Design Services.pdf
DOC
UTEP毕业证学历认证,宾夕法尼亚克拉里恩大学毕业证未毕业
PPTX
Viber For Windows 25.7.1 Crack + Serial Keygen
PDF
SOFTWARE ENGINEERING Software Engineering (3rd Edition) by K.K. Aggarwal & Yo...
PPT
3.Software Design for software engineering
PPTX
Python is a high-level, interpreted programming language
PPTX
Plex Media Server 1.28.2.6151 With Crac5 2022 Free .
PPTX
hospital managemt ,san.dckldnklcdnkdnkdnjadnjdjn
PDF
novaPDF Pro 11.9.482 Crack + License Key [Latest 2025]
PDF
Workplace Software and Skills - OpenStax
PDF
Internet Download Manager IDM Crack powerful download accelerator New Version...
PPTX
Presentation by Samna Perveen And Subhan Afzal.pptx
PDF
Microsoft Office 365 Crack Download Free
PPTX
string python Python Strings: Literals, Slicing, Methods, Formatting, and Pra...
PPTX
Lecture 5 Software Requirement Engineering
PPTX
Computer Software - Technology and Livelihood Education
DOCX
Modern SharePoint Intranet Templates That Boost Employee Engagement in 2025.docx
PPTX
Full-Stack Developer Courses That Actually Land You Jobs
PDF
Sun and Bloombase Spitfire StoreSafe End-to-end Storage Security Solution
PDF
Guide to Food Delivery App Development.pdf
Website Design & Development_ Professional Web Design Services.pdf
UTEP毕业证学历认证,宾夕法尼亚克拉里恩大学毕业证未毕业
Viber For Windows 25.7.1 Crack + Serial Keygen
SOFTWARE ENGINEERING Software Engineering (3rd Edition) by K.K. Aggarwal & Yo...
3.Software Design for software engineering
Python is a high-level, interpreted programming language
Plex Media Server 1.28.2.6151 With Crac5 2022 Free .
hospital managemt ,san.dckldnklcdnkdnkdnjadnjdjn
novaPDF Pro 11.9.482 Crack + License Key [Latest 2025]
Workplace Software and Skills - OpenStax
Internet Download Manager IDM Crack powerful download accelerator New Version...
Presentation by Samna Perveen And Subhan Afzal.pptx
Microsoft Office 365 Crack Download Free
string python Python Strings: Literals, Slicing, Methods, Formatting, and Pra...
Lecture 5 Software Requirement Engineering
Computer Software - Technology and Livelihood Education
Modern SharePoint Intranet Templates That Boost Employee Engagement in 2025.docx
Full-Stack Developer Courses That Actually Land You Jobs
Sun and Bloombase Spitfire StoreSafe End-to-end Storage Security Solution
Guide to Food Delivery App Development.pdf

Transactions in micro-services (fall 2019)