quarkusio/quarkus · error · IllegalArgumentException

Invalid @Scheduled method '<method>': 'fixedDelay' not suppo

Error message

Invalid @Scheduled method '<method>': 'fixedDelay' not supported

What it means

Quarkus's Spring scheduled extension translates Spring's @Scheduled to Quarkus scheduling, but fixedDelay semantics (delay between end of previous execution and start of the next) are not supported by the translation. Any @Scheduled method using fixedDelay or fixedDelayString is rejected at build time.

Source

Thrown at extensions/spring-scheduled/deployment/src/main/java/io/quarkus/spring/scheduled/deployment/SpringScheduledProcessor.java:102

    void processSpringScheduledAnnotation(BuildProducer<ScheduledBusinessMethodItem> scheduledBusinessMethods,
            BeanInfo bean, MethodInfo method, List<AnnotationInstance> scheduledAnnotations) {
        List<AnnotationInstance> schedules = new ArrayList<>();
        if (scheduledAnnotations != null) {
            for (AnnotationInstance scheduledAnnotation : scheduledAnnotations) {
                List<AnnotationValue> springAnnotationValues = scheduledAnnotation.values();
                List<AnnotationValue> confValues = new ArrayList<>();
                if (!springAnnotationValues.isEmpty()) {
                    if (annotationsValuesContain(springAnnotationValues, "fixedRate")
                            || annotationsValuesContain(springAnnotationValues, "fixedRateString")) {
                        confValues.add(buildEveryParam(springAnnotationValues));
                        if (annotationsValuesContain(springAnnotationValues, "initialDelay")
                                || annotationsValuesContain(springAnnotationValues, "initialDelayString")) {
                            confValues.addAll(buildDelayParams(springAnnotationValues));
                        }

                    } else if (annotationsValuesContain(springAnnotationValues, "fixedDelay")
                            || annotationsValuesContain(springAnnotationValues, "fixedDelayString")) {
                        throw new IllegalArgumentException(
                                "Invalid @Scheduled method '" + method.name()
                                        + "': 'fixedDelay' not supported");
                    } else if (annotationsValuesContain(springAnnotationValues, "cron")) {
                        if (annotationsValuesContain(springAnnotationValues, "initialDelay")) {
                            throw new IllegalArgumentException(
                                    "Invalid @Scheduled method '" + method.name()
                                            + "': 'initialDelay' not supported for cron triggers");
                        }
                        confValues.add(buildCronParam(springAnnotationValues));
                    }

                }
                AnnotationInstance regularAnnotationInstance = AnnotationInstance.create(QUARKUS_SCHEDULED,
                        scheduledAnnotation.target(), confValues);
                schedules.add(regularAnnotationInstance);
            }
            if (schedules != null) {
                scheduledBusinessMethods.produce(new ScheduledBusinessMethodItem(bean, method, schedules));

View on GitHub (pinned to e1c734241f)

Solutions

  1. Replace fixedDelay with fixedRate if fixed-pace periodic execution is acceptable
  2. Use a cron expression to achieve delay-like behavior
  3. Drop the spring-scheduled extension and use Quarkus native @Scheduled with its period/delay attributes
  4. Implement the delay logic inside the scheduled method or a dedicated executor

Example fix

// before
@Scheduled(fixedDelay = 5000)
void poll() {}

// after
@Scheduled(fixedRate = 5000)
void poll() {}
Defensive patterns

Strategy: validation

Validate before calling

Scheduled s = method.getAnnotation(Scheduled.class);
if (s != null && (s.fixedDelay() > 0 || !s.fixedDelayString().isEmpty())) {
    throw new IllegalStateException("fixedDelay unsupported: use fixedRate or cron on " + method.getName());
}

Prevention

When it happens

Trigger: Annotating a bean method with @Scheduled(fixedDelay = 5000) or @Scheduled(fixedDelayString = "5000") in a Quarkus application using the spring-scheduled extension.

Common situations: Migrating Spring Boot scheduled jobs to Quarkus without converting fixedDelay to fixedRate; copying Spring scheduling examples verbatim.

Related errors


AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05). Data as JSON: /api/errors/14f5db177535c7a7. Report an issue: GitHub.