Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Distributed Locking in Mule
1. Distributed Locking Mule
Mule provides the ability to create locks for synchronizing
access to resources within Mule components. To manage
concurrent access to resources within a server cluster, Mule
provides a lock factory which custom components – such as
custom transformers and DevKit-built components – access
programmatically.
With the locks in place, you can deploy code in a single mule
server or a Mule cluster without causing any issues with
resource synchronization. Further, Mule’s locking system
offers a simple API to access shared locks.
4. Distributed Locking Mule – Flow
Contd…
• Business logic inside try block will be executed
Synchronously
• Java Transform component to apply locking
• Extends “AbstractMessageTransformer”
(org.mule.transformer.AbstractMessageTransformer)
to access muleContext Object
• Create Lock (java.util.concurrent.locks.Lock) Object
for lockid “1234”
• Used lock() to get lock
• Used unlock() to release the lock