![](https://img-blog.csdnimg.cn/20201014180756919.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
spring boot
阿懒图灵
琢石成器
展开
-
spring boot 集成多线程
线程池的配置文件新建配置文件application.yml 添加内容#线程池配置spring: task: pool: corePoolSize : 4 maxPoolSize : 8 keepAliveSeconds : 60 queueCapacity : 20新建线程池参数装载类@ConfigurationProperties(p原创 2017-10-26 18:25:53 · 5029 阅读 · 6 评论 -
spring boot 集成 quartz,实现动态控制
spring boot 集成 quartzspring boot 自带的定时任务 schedule使用起来非常简单,但是确不灵活。如果需要动态的去修改任务间隔,可以实现,但就是比较麻烦。这里记录一下quartz在spring boot 中的使用,权当抛砖引玉。1、引入jar包 <dependency> <groupId>org.quartz-scheduler</groupId原创 2017-10-26 12:00:47 · 534 阅读 · 0 评论 -
spring boot 集成websocket实现实时推送
websocket暂时能想到的应用是浏览器聊天和后台日志实时显示到前台。当后台启动程序后,等待前台连接,连接上之后,前后台就可以相互发送数据了。先贴上pom配置:<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</ar原创 2017-11-06 20:38:36 · 11256 阅读 · 5 评论 -
spring boot的一些配置应用
1、使用前端模板thymeleaf,会要求使用严格的html标签严格的html标签会很麻烦,会大大降低前端开发效率,下面的步骤可以去除严格的html标签限制。配置文件application.xml中增加: spring.thymeleaf.mode=LEGACYHTML5pom文件中增加:<dependency> <groupId>net.sourceforge.nek原创 2017-11-07 19:09:20 · 375 阅读 · 0 评论 -
spring boot的一些配置二
1、web项目启动,自动运行指定方法。定义一个类实现CommandLineRunner接口的run方法 当项目启动后,会自动运行run方法 定义的类上需要加上注解@Component@Componentpublic class MyCommandLineRunner implements CommandLineRunner{ @Override public void run(S原创 2017-11-08 10:42:01 · 432 阅读 · 0 评论 -
spring boot 集成mybatis
要在spring boot中使用mybatis,首先需要在项目中引入jar包 在pom.xml文件中添加配置:<dependency> <groupId>org.mybatis.spring.boot</groupId> <artifactId>mybatis-spring-boot-starter</artifactId> <version>1.3.0</version>原创 2017-11-09 20:03:03 · 390 阅读 · 0 评论 -
使用idea+springboot+Mybatis搭建web项目
使用idea+springboot+Mybatis搭建web项目springboot的优势之一就是快速搭建项目,省去了自己导入jar包和配置xml的时间,使用非常方便。1、创建项目project,然后选择Spring initializr,点击下一步 2、按图示进行勾选,点击下一步,给项目起个名字,点击确定。3、项目生成有,点击add as maven project,idea原创 2017-02-06 15:20:45 · 47752 阅读 · 19 评论 -
spring boot 集成 RabbitMQ
RabbitMQ是一个消息中间件,负责项目间消息的传递。使用消息中间件可以做到项目间解耦和消息的异步处理。支持多语言开发。RabbitMQ原理:首先是在RabbitMQ创建所需的exchange中转站和queue队列。创建exchange和queue可以通过服务器代码实现,也可以通过RabbitMQ提供的web管理界面或者http api来操作。消息生产者服务器将消息发送到指定的exchange中转原创 2017-12-28 16:39:01 · 417 阅读 · 0 评论