Cloud Native, Container First Java framework for building efficient Java applications with fast startup times and low memory usage
—
Quarkus provides cron-like scheduling capabilities with programmatic scheduler access and comprehensive lifecycle event handling for background task management.
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
public @interface Scheduled {
String cron() default "";
String every() default "";
long delay() default -1;
TimeUnit delayUnit() default TimeUnit.MILLISECONDS;
String identity() default "";
boolean skipExecutionIf() default false;
}Schedules method execution based on cron expressions or intervals.
public interface Scheduler {
void pause();
void resume();
boolean isRunning();
List<Trigger> getScheduledJobs();
}Programmatic scheduler control interface.
Usage Example:
@ApplicationScoped
public class TaskScheduler {
@Scheduled(every = "30s")
public void performCleanup() {
System.out.println("Performing cleanup task");
}
@Scheduled(cron = "0 0 2 * * ?") // Daily at 2 AM
public void generateReports() {
System.out.println("Generating daily reports");
}
}Install with Tessl CLI
npx tessl i tessl/maven-io-quarkus--quarkus-bom