We have an event resource that has a ZoneDateTime that represents its start timestamp as well as a unique identifier (Primary Key). Users can check into an event. The goal is to schedule a task that gets executed an hour before the events start timestamp in order to notify the users that are checked into this event with our Push Notification service.
The solution needs to be scalable as well as have the ability for the task to reference the corresponding eventId so we can determine the users that are checked in. The task also needs to be scheduled programmatically as every event has a different start time.
I am looking for a good resource or tool to use. Unless I am missing something, it seems like Spring Boot's native scheduler is not capable of performing this task. I also have looked into Quartz but I am unsure how to handle the requirement of storing the specific event id with the scheduled task.
As this is my first time scheduling something like this, I would appreciate any resources or thoughts you can give me.
You need a more abstract approach to your problem.
You don't need to schedule every event, you only need to schedule the next event. If the scheduler triggers & executes you have to do a little more work:
With this approach you don't have a scaling problem, because you only schedule exactly 1 event.
NOTE: This is a very simple approach. You may adapt this to your specific problem: