Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JobModelBrowse says that jobs are active with spring.quartz.auto-startup=false #1079

Closed
Yarik2308 opened this issue Oct 9, 2022 · 1 comment
Assignees
Labels
in: quartz type: bug Something isn't working
Projects
Milestone

Comments

@Yarik2308
Copy link

Yarik2308 commented Oct 9, 2022

Forum question

  1. Create new project
  2. add 'io.jmix.quartz:jmix-quartz-starter'
  3. add job
open class TestJob: Job {

    @Authenticated
    override fun execute(context: JobExecutionContext) {
        log.info("TestJob")
    }

    companion object {
        private val log = LoggerFactory.getLogger(TestJob::class.java)
    }
}
  1. add Configuration
@Configuration
open class JobConfig {

    @Bean("test_TestJob")
    open fun eventConfJob(): JobDetail {
        return JobBuilder.newJob()
            .ofType(TestJob::class.java)
            .storeDurably()
            .withIdentity("testJob")
            .build()
    }

    @Bean("test_TestTrigger")
    open fun eventConfTrigger(@Qualifier("test_TestJob") jobDetail: JobDetail): Trigger {
        val period = 60
        log.info("Schedule TestJob using Period of {} seconds", period)
        return TriggerBuilder.newTrigger()
            .withIdentity("testJob")
            .forJob(jobDetail)
            .startNow()
            .withSchedule(simpleSchedule()
                .withIntervalInSeconds(period)
                .repeatForever())
            .build()
    }

    companion object {
        private val log = LoggerFactory.getLogger(JobConfig::class.java)
    }

}

5.Start application. Console shows that job is active and running. Jobs are in NORMAL state in JobModelBrowse
6. Stop application, Add property spring.quartz.auto-startup=false and start again
ER: Jobs should be in PAUSED state in JobModelBrowse
AR: Jobs are in NORMAL state, but they do not run. Try to Pause job and Execute Now/Resume -> they do not run

@gorbunkov gorbunkov added type: bug Something isn't working in: quartz labels Oct 31, 2022
@gorbunkov gorbunkov added this to Backlog in Release 1.4 via automation Oct 31, 2022
@gorbunkov gorbunkov moved this from Backlog to Next in Release 1.4 Dec 12, 2022
@GurSergey GurSergey moved this from Next to In progress in Release 1.4 Dec 13, 2022
GurSergey pushed a commit that referenced this issue Dec 13, 2022
@GurSergey GurSergey moved this from In progress to Review in Release 1.4 Dec 14, 2022
@GurSergey GurSergey moved this from Review to QA in Release 1.4 Dec 15, 2022
@MaxKatyshev
Copy link

Jmix version: 1.4.999-SNAPSHOT - verified

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: quartz type: bug Something isn't working
Projects
Release 1.4
  
Done
Development

No branches or pull requests

4 participants