Recently, I was given an opportunity to implement a use case where the team concluded that using Enterprise Integration Patterns (EIP) would help. Our distributed environment allowed for it, and we started to have discussions using the EIP lingo. While trying to use the Splitter
and Aggregator
patterns, I had a chance to review the source code, and learned first hand how Spring Integration implements several of these patterns.
I recommended highly the following articles:
A summary of some design points that helped my implementation using “distributed locks”:
- Distributed locks always have a “shelf life” (so it’s really a “lease”).
- Expiration of a “lock” is essential.
- Use an EIP framework that supports components that remain simple.
- Potential need to move deployments models to a platform environment following a microservices architecture.
So keeping these in mind, Spring Integration worked well. The key objects used were LockRegistry
1, LockRepository
2 and MessageStore
3.
Both XML and Spring POJO Configuration style worked well for managing these via Spring Profiles, and thanks to Spring Boot, keeping these simple was a breeze.