2021年8月16日 | Leave a comment 问题: spring boot application.yml 中 quartz 的所有配置参数清单在哪? 解决: https://github.com/spring-projects/spring-boot/blob/c406dda18160a29649eef6bbb73f3c93674f4028/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/quartz/QuartzProperties.java http://www.quartz-scheduler.org/documentation/quartz-2.3.0/configuration/ spring.quartz.properties.org.quartz.threadPool.threadCount=50 @ConfigurationProperties("spring.quartz") public class QuartzProperties { /** * Quartz job store type. */ private JobStoreType jobStoreType = JobStoreType.MEMORY; /** * Name of the scheduler. */ private String schedulerName; /** * Whether to automatically start the scheduler after initialization. */ private boolean autoStartup = true; /** * Delay after which the scheduler is started once initialization completes. Setting * this property makes sense if no jobs should be run before the entire application * has started up. */ private Duration startupDelay = Duration.ofSeconds(0); /** * Whether to wait for running jobs to complete on shutdown. */ private boolean waitForJobsToCompleteOnShutdown = false; /** * Whether configured jobs should overwrite existing job definitions. */ private boolean overwriteExistingJobs = false; /** * Additional Quartz Scheduler properties. */ private final Map<String, String> properties = new HashMap<>(); private final Jdbc jdbc = new Jdbc(); public JobStoreType getJobStoreType() { return this.jobStoreType; } public void setJobStoreType(JobStoreType jobStoreType) { this.jobStoreType = jobStoreType; } public String getSchedulerName() { return this.schedulerName; } public void setSchedulerName(String schedulerName) { this.schedulerName = schedulerName; } public boolean isAutoStartup() { return this.autoStartup; } public void setAutoStartup(boolean autoStartup) { this.autoStartup = autoStartup; } public Duration getStartupDelay() { return this.startupDelay; } public void setStartupDelay(Duration startupDelay) { this.startupDelay = startupDelay; } public boolean isWaitForJobsToCompleteOnShutdown() { return this.waitForJobsToCompleteOnShutdown; } public void setWaitForJobsToCompleteOnShutdown(boolean waitForJobsToCompleteOnShutdown) { this.waitForJobsToCompleteOnShutdown = waitForJobsToCompleteOnShutdown; } public boolean isOverwriteExistingJobs() { return this.overwriteExistingJobs; } public void setOverwriteExistingJobs(boolean overwriteExistingJobs) { this.overwriteExistingJobs = overwriteExistingJobs; } public Map<String, String> getProperties() { return this.properties; } public Jdbc getJdbc() { return this.jdbc; } public static class Jdbc { private static final String DEFAULT_SCHEMA_LOCATION = "classpath:org/quartz/impl/" + "jdbcjobstore/tables_@@platform@@.sql"; /** * Path to the SQL file to use to initialize the database schema. */ private String schema = DEFAULT_SCHEMA_LOCATION; /** * Database schema initialization mode. */ private DatabaseInitializationMode initializeSchema = DatabaseInitializationMode.EMBEDDED; /** * Prefixes for single-line comments in SQL initialization scripts. */ private List<String> commentPrefix = new ArrayList<>(Arrays.asList("#", "--")); public String getSchema() { return this.schema; } public void setSchema(String schema) { this.schema = schema; } public DatabaseInitializationMode getInitializeSchema() { return this.initializeSchema; } public void setInitializeSchema(DatabaseInitializationMode initializeSchema) { this.initializeSchema = initializeSchema; } public List<String> getCommentPrefix() { return this.commentPrefix; } public void setCommentPrefix(List<String> commentPrefix) { this.commentPrefix = commentPrefix; } } } 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145 @ConfigurationProperties("spring.quartz")public class QuartzProperties { /** * Quartz job store type. */ private JobStoreType jobStoreType = JobStoreType.MEMORY; /** * Name of the scheduler. */ private String schedulerName; /** * Whether to automatically start the scheduler after initialization. */ private boolean autoStartup = true; /** * Delay after which the scheduler is started once initialization completes. Setting * this property makes sense if no jobs should be run before the entire application * has started up. */ private Duration startupDelay = Duration.ofSeconds(0); /** * Whether to wait for running jobs to complete on shutdown. */ private boolean waitForJobsToCompleteOnShutdown = false; /** * Whether configured jobs should overwrite existing job definitions. */ private boolean overwriteExistingJobs = false; /** * Additional Quartz Scheduler properties. */ private final Map<String, String> properties = new HashMap<>(); private final Jdbc jdbc = new Jdbc(); public JobStoreType getJobStoreType() { return this.jobStoreType; } public void setJobStoreType(JobStoreType jobStoreType) { this.jobStoreType = jobStoreType; } public String getSchedulerName() { return this.schedulerName; } public void setSchedulerName(String schedulerName) { this.schedulerName = schedulerName; } public boolean isAutoStartup() { return this.autoStartup; } public void setAutoStartup(boolean autoStartup) { this.autoStartup = autoStartup; } public Duration getStartupDelay() { return this.startupDelay; } public void setStartupDelay(Duration startupDelay) { this.startupDelay = startupDelay; } public boolean isWaitForJobsToCompleteOnShutdown() { return this.waitForJobsToCompleteOnShutdown; } public void setWaitForJobsToCompleteOnShutdown(boolean waitForJobsToCompleteOnShutdown) { this.waitForJobsToCompleteOnShutdown = waitForJobsToCompleteOnShutdown; } public boolean isOverwriteExistingJobs() { return this.overwriteExistingJobs; } public void setOverwriteExistingJobs(boolean overwriteExistingJobs) { this.overwriteExistingJobs = overwriteExistingJobs; } public Map<String, String> getProperties() { return this.properties; } public Jdbc getJdbc() { return this.jdbc; } public static class Jdbc { private static final String DEFAULT_SCHEMA_LOCATION = "classpath:org/quartz/impl/" + "jdbcjobstore/tables_@@platform@@.sql"; /** * Path to the SQL file to use to initialize the database schema. */ private String schema = DEFAULT_SCHEMA_LOCATION; /** * Database schema initialization mode. */ private DatabaseInitializationMode initializeSchema = DatabaseInitializationMode.EMBEDDED; /** * Prefixes for single-line comments in SQL initialization scripts. */ private List<String> commentPrefix = new ArrayList<>(Arrays.asList("#", "--")); public String getSchema() { return this.schema; } public void setSchema(String schema) { this.schema = schema; } public DatabaseInitializationMode getInitializeSchema() { return this.initializeSchema; } public void setInitializeSchema(DatabaseInitializationMode initializeSchema) { this.initializeSchema = initializeSchema; } public List<String> getCommentPrefix() { return this.commentPrefix; } public void setCommentPrefix(List<String> commentPrefix) { this.commentPrefix = commentPrefix; } } } 参考: