diff --git a/extensions/quartz/deployment/src/main/java/io/quarkus/quartz/deployment/QuartzProcessor.java b/extensions/quartz/deployment/src/main/java/io/quarkus/quartz/deployment/QuartzProcessor.java index 57c8a380de352..baa5f31e07d94 100644 --- a/extensions/quartz/deployment/src/main/java/io/quarkus/quartz/deployment/QuartzProcessor.java +++ b/extensions/quartz/deployment/src/main/java/io/quarkus/quartz/deployment/QuartzProcessor.java @@ -206,7 +206,7 @@ List reflectiveClasses(QuartzBuildTimeConfig config, QuartzJDBCDriverDialectBuildItem driverDialect) { List reflectiveClasses = new ArrayList<>(); - if (config.serializeJobData().orElse(false)) { + if (config.serializeJobData()) { reflectiveClasses.add(ReflectiveClassBuildItem.builder( String.class, JobDataMap.class, diff --git a/extensions/quartz/runtime/src/main/java/io/quarkus/quartz/runtime/QuartzBuildTimeConfig.java b/extensions/quartz/runtime/src/main/java/io/quarkus/quartz/runtime/QuartzBuildTimeConfig.java index a21fdd41c79a4..10442f7b7e05d 100644 --- a/extensions/quartz/runtime/src/main/java/io/quarkus/quartz/runtime/QuartzBuildTimeConfig.java +++ b/extensions/quartz/runtime/src/main/java/io/quarkus/quartz/runtime/QuartzBuildTimeConfig.java @@ -115,7 +115,7 @@ public interface QuartzBuildTimeConfig { * This is equivalent of setting `org.quartz.jobStore.useProperties` to `true`. */ @WithDefault("false") - Optional serializeJobData(); + boolean serializeJobData(); /** * Instance ID generators. diff --git a/extensions/quartz/runtime/src/main/java/io/quarkus/quartz/runtime/QuartzSchedulerImpl.java b/extensions/quartz/runtime/src/main/java/io/quarkus/quartz/runtime/QuartzSchedulerImpl.java index 0100eafabf819..6a919c9200d67 100644 --- a/extensions/quartz/runtime/src/main/java/io/quarkus/quartz/runtime/QuartzSchedulerImpl.java +++ b/extensions/quartz/runtime/src/main/java/io/quarkus/quartz/runtime/QuartzSchedulerImpl.java @@ -135,7 +135,7 @@ public QuartzSchedulerImpl(SchedulerContext context, QuartzSupport quartzSupport this.schedulerConfig = schedulerConfig; this.storeType = quartzSupport.getBuildTimeConfig().storeType(); - StartMode startMode = schedulerRuntimeConfig.startMode().orElse(StartMode.NORMAL); + StartMode startMode = schedulerRuntimeConfig.startMode(); boolean forceStart; if (startMode != StartMode.NORMAL) { @@ -594,7 +594,7 @@ private Properties getSchedulerConfigurationProperties(QuartzSupport quartzSuppo if (buildTimeConfig.storeType().isDbStore()) { String dataSource = buildTimeConfig.dataSourceName().orElse("QUARKUS_QUARTZ_DEFAULT_DATASOURCE"); QuarkusQuartzConnectionPoolProvider.setDataSourceName(dataSource); - boolean serializeJobData = buildTimeConfig.serializeJobData().orElse(false); + boolean serializeJobData = buildTimeConfig.serializeJobData(); props.put(StdSchedulerFactory.PROP_JOB_STORE_USE_PROP, serializeJobData ? "false" : "true"); props.put(StdSchedulerFactory.PROP_JOB_STORE_PREFIX + ".tablePrefix", buildTimeConfig.tablePrefix()); props.put(StdSchedulerFactory.PROP_JOB_STORE_PREFIX + ".dataSource", dataSource); diff --git a/extensions/scheduler/runtime/src/main/java/io/quarkus/scheduler/runtime/SchedulerRuntimeConfig.java b/extensions/scheduler/runtime/src/main/java/io/quarkus/scheduler/runtime/SchedulerRuntimeConfig.java index 5bf250d4fbb9d..70081d0008ebe 100644 --- a/extensions/scheduler/runtime/src/main/java/io/quarkus/scheduler/runtime/SchedulerRuntimeConfig.java +++ b/extensions/scheduler/runtime/src/main/java/io/quarkus/scheduler/runtime/SchedulerRuntimeConfig.java @@ -1,7 +1,6 @@ package io.quarkus.scheduler.runtime; import java.time.Duration; -import java.util.Optional; import io.quarkus.runtime.annotations.ConfigPhase; import io.quarkus.runtime.annotations.ConfigRoot; @@ -29,7 +28,8 @@ public interface SchedulerRuntimeConfig { * Scheduler can be started in different modes. By default, the scheduler is not started unless a * {@link io.quarkus.scheduler.Scheduled} business method is found. */ - Optional startMode(); + @WithDefault("normal") + StartMode startMode(); enum StartMode { diff --git a/extensions/scheduler/runtime/src/main/java/io/quarkus/scheduler/runtime/SimpleScheduler.java b/extensions/scheduler/runtime/src/main/java/io/quarkus/scheduler/runtime/SimpleScheduler.java index 38ffda8ceb42f..fb7a01d323f4b 100644 --- a/extensions/scheduler/runtime/src/main/java/io/quarkus/scheduler/runtime/SimpleScheduler.java +++ b/extensions/scheduler/runtime/src/main/java/io/quarkus/scheduler/runtime/SimpleScheduler.java @@ -97,7 +97,7 @@ public SimpleScheduler(SchedulerContext context, SchedulerRuntimeConfig schedule return; } - StartMode startMode = schedulerRuntimeConfig.startMode().orElse(StartMode.NORMAL); + StartMode startMode = schedulerRuntimeConfig.startMode(); if (startMode == StartMode.NORMAL && context.getScheduledMethods(Scheduled.SIMPLE).isEmpty() && !context.forceSchedulerStart()) { this.scheduledExecutor = null;