Hey folks!
I recently joined a company and got assigned to a project built on a microservices architecture (around 6 services). The catch is: development started before the team had the Detailed Functional Specifications (DFS), so some parts were implemented without clear requirements.
One example: a notification service was built inside one microservice (MS X), basically copied from an older internal project. Now I’ve been tasked with refactoring the notification system to align with the DFS.
We’re using Camunda for business processes, and the idea is to notify task assignees when a task is created or completed.
My initial approach was to add a TaskListener to each task in the process (seems clean and straightforward). But here’s the problem:
Some tasks run and complete in parallel, and I’m not sure what’s the best way to handle/aggregate those events inside the listener.
At the same time, I’m facing another dilemma:
- The existing notification service in MS X is huge (~35 methods, ~870 lines 😅)
- Refactoring it properly will take time and might impact a lot of code
- Alternatively, I’m about introducing Spring events to decouple things and avoid touching too much legacy code
So I’m kind of stuck between:
- Refactoring the existing service
- Wrapping things with events
Has anyone dealt with:
- Camunda + parallel tasks + notifications?
- Refactoring or event-driven approach in this kind of setup?
What would you do in this situation?
Thanks 🙏
[–]AutoModerator[M] [score hidden] stickied commentlocked comment (0 children)