title: Spring Boot Quartz Scheduler Configuration
body: <p>I want to move our Quartz Scheduling configuration to our <code>application.yml</code> instead of maintaining a separate <code>quartz.properties</code> file.</p>
  
  <p>Our Spring Boot application runs and picks up the configuration as expected when using <code>quartz.properties</code> file, but it doesn't pick up the config from <code>application.yml</code>.</p>
  
  <p>Scheduler bean:</p>
  
  <pre><code>@SpringBootApplication
  public class MyApp{
      public static void main(String[] args) {
          SpringApplication.run(MyApp.class, args);
      }
  
      ...
  
      @Bean
      public Scheduler scheduler(SomeCustomConfig cfg, RestTemplate restTemplate) throws SchedulerException {
          //StdSchedulerFactory schedulerFactory = new StdSchedulerFactory();
          //schedulerFactory.initialize("quartz.properties");
          Scheduler scheduler = StdSchedulerFactory.getDefaultScheduler();
          scheduler.getContext().put("restTemplate", restTemplate);
          scheduler.getContext().put("cfg", cfg);
          return scheduler;
      }
  
  }
  </code></pre>
  
  <p>Pertinent <code>application.yml</code>:</p>
  
  <pre><code>spring:
      application.name: myApp
      quartz:
          properties:
              org:
                  quartz:
                      scheduler:
                          instanceId: AUTO
                      threadPool:
                          threadCount: 5
                      plugin:
                          shutdownhook:
                              class: org.quartz.plugins.management.ShutdownHookPlugin
                              cleanShutdown: TRUE
                      jobStore:
                          class: org.quartz.impl.jdbcjobstore.JobStoreTX
                          driverDelegateClass: org.quartz.impl.jdbcjobstore.PostgreSQLDelegate
                          tablePrefix: my_schema.
                          isClustered: true
                          dataSource: myDataSource
                      dataSource:
                          myDataSource:
                              driver: org.postgresql.Driver
                              URL: jdbc:postgresql://localhost/myDataSource
                              user: removed
                              password: removed
  </code></pre>
  
  <p>Our <code>quartz.properties</code> was:</p>
  
  <pre><code>org.quartz.scheduler.instanceId = AUTO
  org.quartz.plugin.shutdownhook.class = org.quartz.plugins.management.ShutdownHookPlugin
  org.quartz.plugin.shutdownhook.cleanShutdown = TRUE
  org.quartz.threadPool.threadCount = 5
  org.quartz.jobStore.class = org.quartz.impl.jdbcjobstore.JobStoreTX
  org.quartz.jobStore.driverDelegateClass = org.quartz.impl.jdbcjobstore.PostgreSQLDelegate
  org.quartz.jobStore.tablePrefix = my_schema.
  org.quartz.jobStore.isClustered = true
  org.quartz.jobStore.dataSource = myDataSource
  org.quartz.dataSource.myDataSource.driver = org.postgresql.Driver
  org.quartz.dataSource.myDataSource.URL = jdbc:postgresql://localhost/myDataSource
  org.quartz.dataSource.myDataSource.user = removed
  org.quartz.dataSource.myDataSource.password = removed
  </code></pre>
  
  <p>I feel like I'm missing something?</p>