I am trying to develop a micro service using Java/Redis/AMQ stack. The business requirement is that on receiving an order event on the JMS topic the service should:
- Wait X number of seconds for the order to be completed.
- Stop the timer if the order completion event is received on JMS.
- Cancel order if order completion event is not received within X number of seconds.
To achieve this behaviour, I'm using timers.However, because timers are running in memory, this causes my service to become state-full.
Can someone point me in the right direction for implementing stateless timers in micro-services?