0

Need to send notifications to users using scheduler based on record in database,

We have Admins who can create Notification configuration from application. Based on that I need to run scheduler and send notifications to respective users who are falling in that notification criteria.

Specifications:

Springboot 2.7.15 Postgres 14

Narendar Reddy M
  • 1,499
  • 1
  • 11
  • 18
  • You can use QuartzScheduling https://docs.spring.io/spring-framework/docs/5.3.x/reference/html/integration.html#scheduling-quartz-cron – Alex Sep 01 '23 at 11:20
  • Does this answer your question? [Spring Boot : Getting @Scheduled cron value from database](https://stackoverflow.com/questions/37113327/spring-boot-getting-scheduled-cron-value-from-database) – Alex Sep 01 '23 at 11:23
  • No, If we want to use @Scheduled we need to define job before starting of application, once you running application you can't change the cron. I need to update cron expression based on updates happens. – Narendar Reddy M Sep 01 '23 at 11:27
  • [this](https://github.com/kagkarlsson/db-scheduler) should be easy to use – bilak Sep 01 '23 at 12:23
  • I'm not sure if I understand it correctly, is the database record user specific? Like can user A have a schedule of 1 minute and user B have a schedule of 2 minutes? – g00glen00b Sep 01 '23 at 13:35
  • Then put the schedule on the database side, using [pg_cron](https://github.com/citusdata/pg_cron)? – Umut TEKİN Sep 01 '23 at 13:37

0 Answers0