-
Notifications
You must be signed in to change notification settings - Fork 12
/
application.yml
60 lines (54 loc) · 2.83 KB
/
application.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
server:
port: 8080
spring:
profiles:
active: mysqlDB #切换指定的数据源.
# quartz 调度器配置
quartz:
job-store-type: jdbc #数据持久化方式,可选值:MEMORY、JDBC
auto-startup: true #初始化后是否自动启动计划程序,默认为 true
overwrite-existing-jobs: false #配置的作业是否应覆盖现有的作业定义
scheduler-name: wmxQuartzScheduler # 计划程序的名称
startup-delay: 10s #初始化完成后启动计划程序的延迟时间,默认为 0 秒
wait-for-jobs-to-complete-on-shutdown: false # 关闭时是否等待正在运行的作业完成
#对于 Quartz 自带的配置,即可以使用 quartz 自己的 quartz.properties 配置文件进行配置,也可以直接配置在 properties 属性下,它是一个 map
#quartz 完整配置:https://wangmaoxiong.blog.csdn.net/article/details/105057405#quartz.properties%20%E4%B8%8E%20QuartzProperties%20%E9%85%8D%E7%BD%AE%E9%80%89%E9%A1%B9
properties:
org:
quartz:
jobStore:
#如果不需要将调度命令(例如添加和删除triggers)绑定到其他事务,那么可以通过使用 JobStoreTX 管理事务
class: org.quartz.impl.jdbcjobstore.JobStoreTX
#设置数据库驱动代理,StdJDBCDelegate 是一个使用 JDBC 代码来执行其工作的代理. 其他代理可以在"org.quartz.impl.jdbcjobstore“包或其子包中找到
driverDelegateClass: org.quartz.impl.jdbcjobstore.StdJDBCDelegate
#通知 JobStore 使用的表前缀
tablePrefix: QRTZ_
threadPool:
class: org.quartz.simpl.SimpleThreadPool #quartz 使用的线程池类型,org.quartz.spi.ThreadPool
threadCount: 15 #线程池中的线程总个数,表示最多可以同时执行的个任务/作业个数
threadPriority: 5 #线程优先级
threadsInheritContextClassLoaderOfInitializingThread: true #线程继承初始化线程的上下文类加载器
---
spring:
profiles: h2DB
#h2 数据源配置
datasource:
username: sa
password: 123456
#持久化到本地磁盘,使用混合模式,默认情况下,H2 只运行一个进程访问,true 表示可以多个进程可以访问同一个数据库
url: jdbc:h2:~/test;AUTO_SERVER=TRUE
driver-class-name: org.h2.Driver
#H2 Web 控制台配置,启用 h2 Console 控制台,并设置访问路径
h2:
console:
enabled: true
path: /h2_console
---
spring:
profiles: mysqlDB
datasource:
username: root
password: root
# spring boot 2.1.5 搭配 mysql 驱动 8.0.16,高版本 mysql 驱动的 driver-class-name 值要带 cj;url 值要带时区 serverTimezone
url: jdbc:mysql://127.0.0.1:3306/test?characterEncoding=UTF-8&serverTimezone=UTC
driver-class-name: com.mysql.cj.jdbc.Driver