石英触发器没有被保存到mysql数据库

我试图将石英调度程序作业保存到数据库,以便它可以承受服务器崩溃。并且可以在服务器启动时自动启动。问题是我设法将作业保存在数据库中,但我看不到触发器。石英触发器没有被保存到mysql数据库

关于这个问题的任何想法?我使用石英2.2.1 SimpleTrigger,也尝试过CronTrigger,但没有运气。任何帮助,将不胜感激。

回答:

这个答案只是针对别人提供的信息,所以发布我的配置以供将来参考其他人使用,对我来说这只是配置问题,我手动创建了数据库表。以下是配置。

org.quartz.scheduler.instanceName = quartzScheduler 

org.quartz.jobStore.class = org.quartz.impl.jdbcjobstore.JobStoreTX

org.quartz.jobStore.driverDelegateClass = org.quartz.impl.jdbcjobstore.StdJDBCDelegate

org.quartz.jobStore.tablePrefix = qrtz_

org.quartz.jobStore.dataSource = quartzDataSource

org.quartz.jobStore.useProperties=false

org.quartz.scheduler.skipUpdateCheck=true

# Following is to be changed according to database.

org.quartz.dataSource.quartzDataSource.driver = com.mysql.jdbc.Driver

org.quartz.dataSource.quartzDataSource.URL=jdbc:mysql://localhost:3306/test

org.quartz.dataSource.quartzDataSource.user = root

org.quartz.dataSource.quartzDataSource.password = root

# This should be equal to or more than the number of thread configured below.

org.quartz.dataSource.quartzDataSource.maxConnections = 30

#org.quartz.jobStore.isClustered = false

org.quartz.threadPool.threadCount = 30

org.quartz.threadPool.class = org.quartz.simpl.SimpleThreadPool

org.quartz.threadPool.threadPriority = 5

org.quartz.threadPool.threadsInheritContextClassLoaderOfInitializingThread = true

org.quartz.plugin.triggHistory.class = org.quartz.plugins.history.LoggingTriggerHistoryPlugin

org.quartz.plugin.triggHistory.triggerFiredMessage = Trigger {1}.{0} fired job {6}.{5} at: {4, date, HH:mm:ss MM/dd/yyyy}

org.quartz.plugin.triggHistory.triggerCompleteMessage = Trigger {1}.{0} completed firing job {6}.{5} at {4, date, HH:mm:ss MM/dd/yyyy}

org.quartz.plugin.triggHistory.triggerMisfiredMessage = Trigger {1}.{0} misfired job {6}.{5} at: {4, date, HH:mm:ss MM/dd/yyyy}. Should have fired at: {3, date, HH:mm:ss MM/dd/yyyy}

org.quartz.plugin.shutdownhook.class = org.quartz.plugins.management.ShutdownHookPlugin

org.quartz.plugin.shutdownhook.cleanShutdown = true

# It's plugin that chaeck the configuration file every 10 seconds and updates the database accordingly.

# NOT NEEDED

#org.quartz.plugin.jobInitializer.class=org.quartz.plugins.xml.XMLSchedulingDataProcessorPlugin

#org.quartz.plugin.jobInitializer.fileNames=quartz-scheduler.xml

#org.quartz.plugin.jobInitializer.failOnFileNotFound=true

#org.quartz.plugin.jobInitializer.scanInterval= 10

#org.quartz.plugin.jobInitializer.wrapInUserTransaction=false

这是以quartz.properties的名称存储的,并且在类路径中用于寻找石英。

以上是 石英触发器没有被保存到mysql数据库 的全部内容, 来源链接: utcz.com/qa/258307.html

回到顶部