common-quartz-spring-boot-starter


Лицензия

Лицензия

Категории

Категории

Spring Boot Контейнер Микросервисы Quartz Библиотеки уровня приложения Job Scheduling
Группа

Группа

com.github.fangzhengjin
Идентификатор

Идентификатор

common-quartz-spring-boot-starter
Последняя версия

Последняя версия

0.0.8
Дата

Дата

Тип

Тип

jar
Описание

Описание

common-quartz-spring-boot-starter
common-quartz-spring-boot-starter
Ссылка на сайт

Ссылка на сайт

https://github.com/fangzhengjin/common-quartz-spring-boot-starter
Система контроля версий

Система контроля версий

https://github.com/fangzhengjin/common-quartz-spring-boot-starter

Скачать common-quartz-spring-boot-starter

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/com.github.fangzhengjin/common-quartz-spring-boot-starter/ -->
<dependency>
    <groupId>com.github.fangzhengjin</groupId>
    <artifactId>common-quartz-spring-boot-starter</artifactId>
    <version>0.0.8</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.fangzhengjin/common-quartz-spring-boot-starter/
implementation 'com.github.fangzhengjin:common-quartz-spring-boot-starter:0.0.8'
// https://jarcasting.com/artifacts/com.github.fangzhengjin/common-quartz-spring-boot-starter/
implementation ("com.github.fangzhengjin:common-quartz-spring-boot-starter:0.0.8")
'com.github.fangzhengjin:common-quartz-spring-boot-starter:jar:0.0.8'
<dependency org="com.github.fangzhengjin" name="common-quartz-spring-boot-starter" rev="0.0.8">
  <artifact name="common-quartz-spring-boot-starter" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.fangzhengjin', module='common-quartz-spring-boot-starter', version='0.0.8')
)
libraryDependencies += "com.github.fangzhengjin" % "common-quartz-spring-boot-starter" % "0.0.8"
[com.github.fangzhengjin/common-quartz-spring-boot-starter "0.0.8"]

Зависимости

compile (5)

Идентификатор библиотеки Тип Версия
org.springframework.boot : spring-boot-starter-quartz jar 2.2.5.RELEASE
org.reflections : reflections jar 0.9.11
com.github.fangzhengjin : common-core jar 0.0.9
org.jetbrains.kotlin : kotlin-stdlib-jdk8 jar 1.3.70
org.jetbrains.kotlin : kotlin-reflect jar 1.3.70

runtime (1)

Идентификатор библиотеки Тип Версия
org.springframework.boot : spring-boot-starter-web jar 2.2.5.RELEASE

Модули Проекта

Данный проект не имеет модулей.

common-quartz-spring-boot-starter

Codecov branch Build Status Maven Central Bintray License SpringBootVersion

dependencies {
    implementation "com.github.fangzhengjin:common-quartz-spring-boot-starter:version"
}

使用前需配置quartz 配置样例

spring:
  #QuartZ定时任务
  quartz:
    job-store-type: jdbc
    jdbc:
      #手动初始化数据库
      #脚本位置:org.quartz.impl.jdbcjobstore
      initialize-schema: never
    #相关属性配置
    properties:
      org:
        quartz:
          scheduler:
            #调度器实例名称
            instanceName: clusteredScheduler
            #调度器实例编号自动生成
            instanceId: AUTO
          jobStore:
            class: org.quartz.impl.jdbcjobstore.JobStoreTX
            #数据库
            #MYSQL - org.quartz.impl.jdbcjobstore.StdJDBCDelegate
            #PostgreSQL - org.quartz.impl.jdbcjobstore.PostgreSQLDelegate
            driverDelegateClass: org.quartz.impl.jdbcjobstore.oracle.OracleDelegate
            #数据库表前缀
            tablePrefix: QRTZ_
            #是否开启集群模式
            isClustered: true
            #集群监测间隔
            clusterCheckinInterval: 10000
            #是否使用quartz.properties文件配置
            useProperties: false
          threadPool:
            #ThreadPool 实现的类名
            class: org.quartz.simpl.SimpleThreadPool
            #线程数量
            threadCount: 10
            #线程优先级
            threadPriority: 5
            #自创建父线程
            threadsInheritContextClassLoaderOfInitializingThread: true

自定义Job需要使用@QuartzJobDescription注解修饰并描述用途

配置说明 - application.yml

样例均为默认值

customize:
  common:
    quartz:
      #内置Controller基础地址
      baseUrl: /task
      #是否开启内置Controller
      enableController: true
      #是否在Swagger中展示QuartzControllerApi
      showInSwagger: false
      #是否使用内置异常处理器处理QuartzManagerException异常
      catchQuartzManagerException: true
      #任务执行器扫描路径,如不配置则默认扫描@SpringBootApplication修饰的启动类下的子包
      scanExecJobPackages: youBasePackage

因组件使用reflections进行包扫描,启动过程中会出现大量reflections警告,如需屏蔽警告请添加以下配置项

logging:
  level:
    org.reflections: error

Версии библиотеки

Версия
0.0.8
0.0.7
0.0.6
0.0.5
0.0.4
0.0.3
0.0.2
0.0.1