- 博客(8)
- 资源 (4)
- 问答 (1)
- 收藏
- 关注
原创 spring boot异步执行@Async
1.一般异步执行,使用多线程,或者消息中间件完成2.spring boot@Async可以让方法异步执行package com.example.demo;import org.springframework.scheduling.annotation.Async;import org.springframework.stereotype.Component;import jav...
2018-09-17 23:00:18 170
转载 spring boot定时任务
1.一般的定时任务Timer,Quartz2.spring boot更加便捷的注解方式启动定时任务在启动类添加@EnableScheduling其次新建一个class类package com.example.demo.test1;import org.springframework.scheduling.annotation.Scheduled;import org....
2018-09-16 15:02:04 159
原创 java优化(一)
1.使用clone复制对象,尽量不使用new去新建对象package com.example.demo.Test;public class test2 implements Cloneable{ private static test2 t=new test2(); public static test2 getnewtest2() { try { ...
2018-09-09 13:57:03 260
转载 redis命令总结
1.禁止keys命令使用因为会阻塞服务器,建议使用scan 0查看键。scan 0 match f*,查看f开头的键2.slowlogslowlog get 5获取慢查询5条3.在redis.conf禁用命令添加rename-command keys keysys4.查看最大的键值./redis-cli --bigkeys5../redis-cli monitor ...
2018-09-07 11:27:24 115
转载 java异步执行之线程池
java异步执行可以使用线程,或者第三方消息中间件,如mq线程池的使用:1)Executors来创建线程池ExecutorService cachePool = Executors.newCachedThreadPool(); for (int i=1;i<=10;i++){ cachePool.execute(task); ...
2018-09-04 16:17:25 10768
转载 mybaties批量插入
@Testpublic void testInsertBatch() throws Exception { long start = System.currentTimeMillis(); List<User> list = new ArrayList<>(); User user; for (int i = 0; i < 1000...
2018-09-03 17:33:09 901
转载 shell对nginx状态,mysql的查看
1.nginx状态,它本来就有状态检查的模板这里使用之间访问nginx 的网页,如果是200则成功,其他则提示失败curl -m 5 -s -w %{http_code} 127.0.0.1:8080 -o /dev/null上面是tomcat 的,nginx的链接换下就行 ...
2018-09-02 22:48:34 509
转载 shell批量解压tar.gz tgz
cd /root/home/ls *.tar.gz > ls.logls *.tgz >> ls.logfor i in $( cat ls.log )dotar -zxf $i & > /dev/nulldonerm -rf ls.log& > /dev/null是让输出的东西不要显示出来...
2018-09-02 11:39:25 2000 1
spring boot和mybatis整合小项目
2018-01-08
基于dwr的java推送小项目
2017-10-07
ssm框架整合报错,求大神指导
2017-06-15
TA创建的收藏夹 TA关注的收藏夹
TA关注的人