How can I configure multiple Quartz schedulers with Spring Boot

30 views Asked by At

I need to have multiple schedulers, all clustered with JDBC datastore. Is it possible to configure them in the application.yaml?

I believe for one scheduler it would be like the following I found on the web.

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

Can I specify multiple blocks like that with different names for each scheduler?

0

There are 0 answers