springBoot整合Quarzt2.3
首先,你要配置好springboot的配置(在resources下)
我把其改为application.yml
# Tomcat
server:
tomcat:
uri-encoding: UTF-8
max-threads: 1000
min-spare-threads: 30
port: 8080
servlet:
context-path: /xiaobo spring:
profiles:
active: dev
datasource:
type: com.alibaba.druid.pool.DruidDataSource
driver-class-name: com.mysql.jdbc.Driver
filters: stat
maxActive: 20
initialSize: 1
maxWait: 60000
minIdle: 1
timeBetweenEvictionRunsMillis: 60000
minEvictableIdleTimeMillis: 300000
validationQuery: select 'x'
testWhileIdle: true
testOnBorrow: false
testOnReturn: false
poolPreparedStatements: true
maxOpenPreparedStatements: 20
jackson:
date-format: yyyy-MM-dd HH:mm:ss
time-zone: GMT+8
servlet:
multipart:
max-file-size: 100MB
max-request-size: 100MB
enabled: true
freemarker:
suffix: .html
request-context-attribute: request blgg:
redis:
open: false
shiro:
redis: false #mybatis
mybatis-plus:
mapper-locations: classpath:com/blgg/permission/**/**.xml
#实体扫描,多个package用逗号或者分号分隔
typeAliasesPackage: com.blgg.permission.modules.*.entity
global-config:
#主键类型 0:"数据库ID自增", 1:"用户输入ID",2:"全局唯一ID (数字类型唯一ID)", 3:"全局唯一ID UUID";
id-type: 0
#字段策略 0:"忽略判断",1:"非 NULL 判断"),2:"非空判断"
field-strategy: 2
#驼峰下划线转换
db-column-underline: true
#刷新mapper 调试神器
refresh-mapper: true
#逻辑删除配置
logic-delete-value: -1
logic-not-delete-value: 0
#自定义填充策略接口实现
#meta-object-handler: com.baomidou.springboot.xxx
#自定义SQL注入器
sql-injector: com.baomidou.mybatisplus.mapper.LogicSqlInjector
configuration:
map-underscore-to-camel-case: true
cache-enabled: false
call-setters-on-nulls: true logging:
config: classpath:logback-spring.xml
application.yml
数据源配置在
spring:
datasource:
name: dev
url: jdbc:mysql://localhost:3306/blgg_permission?useUnicode=true&characterEncoding=utf8
username: root
password: root
application-dev.yml
这里我们先写一个任务类
package com.blgg.permission.modules.job.task; import com.blgg.permission.modules.sys.entity.User;
import com.blgg.permission.modules.sys.service.UserService;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; /**
* ┏┓ ┏┓
* ┏┛┻━━━┛┻┓
* ┃ ┃
* ┃ ━ ┃
* ┃ ┳┛ ┗┳ ┃
* ┃ ┃
* ┃ ┻ ┃
* ┃ ┃
* ┗━┓ ┏━┛
* ┃ ┃神兽保佑
* ┃ ┃代码无BUG!
* ┃ ┗━━━┓
* ┃ ┣┓
* ┃ ┏┛
* ┗┓┓┏━┳┓┏┛
* ┃┫┫ ┃┫┫
* ┗┻┛ ┗┻┛
*
*
* @ClassName TestTask
* @Description
* @Author xiaobo
* @Date 2018/10/16/016 1:18
*/
@Component("testTask")
public class TestTask {
private Logger logger=LoggerFactory.getLogger(getClass()); @Autowired
private UserService userService; public void test1(String params){
logger.info("我是带参数的test方法,正在被执行,参数为:"+params); try{
Thread.sleep(1000L);
}catch (InterruptedException e){
e.printStackTrace();
} User user=userService.selectById(1L);
System.out.println(ToStringBuilder.reflectionToString(user));
} public void test2(){
logger.info("我是不带参数的test1方法,正在被执行!");
} }
TestTask
springBoot整合Quarzt2.3的更多相关文章
- spring-boot整合mybatis(1)
sprig-boot是一个微服务架构,加快了spring工程快速开发,以及简便了配置.接下来开始spring-boot与mybatis的整合. 1.创建一个maven工程命名为spring-boot- ...
- SpringBoot整合Mybatis之项目结构、数据源
已经有好些日子没有总结了,不是变懒了,而是我一直在奋力学习springboot的路上,现在也算是完成了第一阶段的学习,今天给各位总结总结. 之前在网上找过不少关于springboot的教程,都是一些比 ...
- springboot整合mq接收消息队列
继上篇springboot整合mq发送消息队列 本篇主要在上篇基础上进行activiemq消息队列的接收springboot整合mq发送消息队列 第一步:新建marven项目,配置pom文件 < ...
- springboot整合mybaits注解开发
springboot整合mybaits注解开发时,返回json或者map对象时,如果一个字段的value为空,需要更改springboot的配置文件 mybatis: configuration: c ...
- SpringBoot整合Redis、ApachSolr和SpringSession
SpringBoot整合Redis.ApachSolr和SpringSession 一.简介 SpringBoot自从问世以来,以其方便的配置受到了广大开发者的青睐.它提供了各种starter简化很多 ...
- SpringBoot整合ElasticSearch实现多版本的兼容
前言 在上一篇学习SpringBoot中,整合了Mybatis.Druid和PageHelper并实现了多数据源的操作.本篇主要是介绍和使用目前最火的搜索引擎ElastiSearch,并和Spring ...
- SpringBoot整合Kafka和Storm
前言 本篇文章主要介绍的是SpringBoot整合kafka和storm以及在这过程遇到的一些问题和解决方案. kafka和storm的相关知识 如果你对kafka和storm熟悉的话,这一段可以直接 ...
- SpringBoot整合SpringCloud搭建分布式应用
什么是SpringCloud? SpringCloud是一个分布式的整体解决方案.SpringCloud为开发者提供了在分布式系统中快速构建的工具,使用SpringCloud可以快速的启动服务或构建应 ...
- SpringBoot整合RabbitMQ-整合演示
本系列是学习SpringBoot整合RabbitMQ的练手,包含服务安装,RabbitMQ整合SpringBoot2.x,消息可靠性投递实现等三篇博客. 学习路径:https://www.imooc. ...
随机推荐
- mac使用brew安装sshpass
brew安装sshpass brew install https://raw.githubusercontent.com/kadwanev/bigboybrew/master/Library/Form ...
- delphi 大文件的读写 使用 MapviewOffile
unit filemap; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, For ...
- Linux下设置动态库的方法
库文件在连接(静态库和共享库)和运行(仅限于使用共享库的程序)时被使用,其搜索路径是在系统中进行设置的. 一般 Linux 系统把 /lib 和 /usr/lib 两个目录作为默认的库搜索路径,所以使 ...
- 吴裕雄 python oracle检索数据(2)
import cx_Oracle conn = cx_Oracle.connect("scott/admin@localhost:1521/orcl")cursor = conn. ...
- webpack相关配置
cd 项目文件夹 npm init -y npm install jquery -S //生成node_modules 下载好jquery 创建webpack.config.js module.exp ...
- PL/SQL Job
1. 鼠标右键点击 jobs 弹出 Create Job 对话框,如下图: 2. 在对话框中输入相应的值,如下图: 其中: What ——作业执行时将要调用的存储过 ...
- phpexcel 导入超过26列时的解决方案
$highestColumn = $sheet->getHighestColumn(); // 取得总列数 ++$highestColumn; for ($row = 5; $row <= ...
- 对于“2017面向对象程序设计(Java)第三周学习总结”存在问题的反馈
对于“2017面向对象程序设计(Java)第三周学习总结”存在问题的反馈 一:教学中存在的学习问题 “1.由于同学们平时练习不足,上课总是出现跟不上老师的节奏的现象. 2.个别同学上课不认真听讲,打开 ...
- 大型运输行业实战_day11_2_事务理论与实际生产配置事务管理
1.什么是事务(Transaction:tx) 数据库的某些需要分步完成,看做是一个整体(独立的工作单元),不能分割,要么整体成功,要么整体生效.“一荣俱荣,一损俱损”,最能体现事务的思想.案例:银行 ...
- 使用in ()进行批量删除
public bool DeleteList(string idlist ) { StringBuilder strSql=new StringBuilder(); strSql.Append(&qu ...