Is Quarkus+Quartz Worth It for Scheduling Tasks Over Plain Quartz?
Asked by
TechieTurtle92
Hey everyone! I have a few scheduled jobs that I kick off using cron expressions in a standalone Java application with Quartz. I've heard that Quartz integrates with Quarkus, and I'm curious if switching to Quarkus is a smart move compared to sticking with plain Quartz.
From what I've gathered, Quarkus is great for fast restarts, but it doesn't restart for every request, so it still functions as a long-running process. What are the advantages of using Quarkus with Quartz? Is it primarily about native images? And if I'm not using native images, how does it stack up?
Also, I'd like to expand this question out to Quartz vs. frameworks like Spring Boot or Javalin. What benefits do you all see with Quartz in environments where long-running processes are a concern? Thanks!
Answers
Quartz uses your database to manage job consistency and prevent concurrent jobs from running across multiple instances. This is a big plus if your service runs in a clustered environment. On the other hand, Quarkus's built-in scheduler is tied to the instance it runs on, which can limit its effectiveness.
Reply to this answer
Have you considered using Spring Boot instead of Quarkus with Quartz? The standard `@Scheduled` annotation is simple and effective. However, if you need dynamic scheduling, Quartz allows you to manage triggers programmatically, which is a feature I find lacking in Springโs basic scheduling.
Reply to this answer
Honestly, it depends on where you're deploying. If you're on Kubernetes, I'd recommend using Kubernetes cron jobs instead of relying on a long-running Java application. Managing cron jobs inside Java should be a last resort, given you'd have to keep the JVM running continuously and track previous job runs carefully.
Reply to this answer
Iโm currently working on a Quarkus/Quartz project and itโs been fantastic! I'm not only using Scheduled annotations but also dynamically building jobs and triggers stored with JDBC. The developer services Quarkus offers make development a breeze, so I'd definitely recommend it over other options.
Reply to this answer
If you don't plan to leverage what Quarkus offers as an application framework, you might not need to switch. But if your project already uses features like dependency injection, Hibernate, or REST clients, then integrating Quartz with Quarkus can enhance your app since it's just another feature you can utilize as needed.
Reply to this answer
Add your answer
Answers are reviewed before publication.
Related Discussions