-
Using: quarkus 3.2.12.Final, hibernate-panache, non-reactive programming I have a microservice with jobs that are scheduled for execution by an external scheduling service. The job needs to process multiple entities. To avoid parallel executions (in case the job hasn't finished before it's called again), we have set up a job_lock table with the job name, and a return find("jobName", jobName)
.withLock(LockModeType.PESSIMISTIC_WRITE)
.withHint(HINT_SPEC_LOCK_TIMEOUT, SKIP_LOCKED)
.singleResultOptional()
.isPresent(); Therefore, the Job executor (that checks if the job is locked and executes the specified job) is marked as To solve this, I have thought of two possible solutions:
My question is: which solution would perform better, in my case? Would smaller |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
nevermind, I'll try a different approach. When the scheduled job runs, I'll query the entities to process and send them to a kafka topic, then the consumer with process each entity separately. |
Beta Was this translation helpful? Give feedback.
nevermind, I'll try a different approach. When the scheduled job runs, I'll query the entities to process and send them to a kafka topic, then the consumer with process each entity separately.