0

I need to code scheduler which will be run every 1.6s and have access to database across two instances of microservices written on java 11 with use of Spring Boot Framework.

I have two possible realiazation in my mind:

  1. Use shedlock for job which will run every 1.6s
  2. Run job every 16s with shedlock and inside such job small async taks.

Can you help with choice of implementation? Maybe you can offer better variant

Robert
  • 371
  • 1
  • 5
  • 15
  • Have you looked into quartz? https://www.baeldung.com/spring-quartz-schedule. It has clustered configuration to ensure only a single node runs a given job – Taylor May 09 '23 at 14:21
  • No. But question is same. Do you think both quartz and shedlock can be suitable for such low period - 1600 ms? Or may be on of them more appropriate. Because as can see for example shedlock's resolution is seconds – Robert May 09 '23 at 14:43
  • Have you read Shedlock documentation to see if it appropriate for your needs? – aled May 09 '23 at 15:04
  • I'm not familiar with Shedlock, I think Quartz could handle that frequency – Taylor May 09 '23 at 15:22

0 Answers0