Search code examples
javamonitoringtracking

Tracking and updating the status in java application


I have java web applciation where we have a system with approvals and confirmations depending on the time period.

the steps of the process are.

  1. user requests for an event to be fired at particular time.

  2. user gets a approval or confirmation mail to be processed.

  3. If user does not approval or confirm with in 5 days,then the system should Cancel the request automatically(a change in database status is enough for this) .

How can i track this kind of request continously ??

  1. should i run any Job continously which takes of changing the status in database? issue : this affects the performance of the system

  2. If i run the system at specific intervals of time, then a cancellation may take some more time than what is expected. this should not happen strictly.

Could anyone give me right direction to handle this kind of cases?


Solution

  • this depends on how your system should work. Let me just outline two options. There are probably a lot more but you'll need to figure out yourself what you want:

    1. You go with an internal scheduler for the actual user defines events. Then why not use the same scheduler for expiring unconfirmed events?
    2. You use external scheduling. E.g. you decide to check every 5 Minutes if there are events to be fired. Then you might just run a cancelation job at the same time.

    Dependig on your system there are a lot more parameters to check... this is just to give an idea.