自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

这儿很凉的博客

这儿很凉,凉到烫手

  • 博客(29)
  • 资源 (1)
  • 收藏
  • 关注

原创 springboot整合quartz,生成的job由spring管理可直接注入

pom.xml<parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>1.5.14.RELEASE</version> &

2018-09-19 14:20:07 2103

翻译 Minio中桶规则

https://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.htmlA bucket is owned by the AWS account that created it. Bucket ownership is not transferable. When you create a bucket, you cho...

2020-03-20 11:27:45 11869

原创 笔记-使用LCN分布式事物demo

注意事项:1.tx-lcn版本5.0.2.RELEASE,对应springboot版本:2.1.2.RELEASE2.先启动LCN事务协调器,具体见:【配置LCN事物协调器】3.客户端添加依赖:<dependency> <groupId>com.codingapi.txlcn</groupId> <artifactId>txlc...

2019-02-28 17:03:07 1612 1

原创 笔记-配置LCN事务协调器

1.下载源码:https://github.com/codingapi/tx-lcn 选择分支2.执行tx-manager.sql的sql,创建tx-manager库及t_tx_exception表3.修改pom文件增加springboot maven插件<plugins> <plugin> <groupId>org.spr...

2019-02-27 16:58:22 1631

转载 springboot2.0集成百度uidgenerator【笔记】

一句该文章做的笔记:https://blog.csdn.net/a13794479495/article/details/835415691.下载源码https://github.com/baidu/uid-generator,并依据官网创建好表修改数据库连接池<!--<dependency> <groupId>com.alibaba</...

2019-02-15 09:45:14 6167 4

转载 项目中常用的19条MySQL优化

做个笔记,来源于https://zhuanlan.zhihu.com/p/498880881、EXPLAIN 做MySQL优化,我们要善用EXPLAIN查看SQL执行计划。下面来个简单的示例,标注(1、2、3、4、5)我们要重点关注的数据:type列,连接类型。一个好的SQL语句至少要达到range级别。杜绝出现all级别。key列,使用到的索引名。如果没有选择索引,值...

2019-01-24 11:38:02 157

转载 Spring Cloud Eureka 常用配置及说明

转自:https://www.cnblogs.com/li3807/p/7282492.html 配置参数 默认值 说明 服务注册中心配置    Bean类:org.springframework.cloud.netflix.eureka.server.EurekaServerCo...

2019-01-04 17:12:15 585

原创 springboot全局处理异常

1.先决条件:springboot默认异常路径/error2.访问http://localhost/user/get/-13.出错后,/error请求会映射到该controller  4.配置error页面,404,500及其它error页面5.配置其它青口请求过来的,如app段,处理异常返回 ...

2019-01-02 14:47:41 136

原创 kryo实现序列化至硬盘与从硬盘反序列

1.依赖<!--序列化工具包--> <dependency> <groupId>com.esotericsoftware</groupId> <artifactId>kryo</artifactId> <version>4.0.2</version&a

2018-12-14 14:22:19 310

原创 springboot2.x adminUI监控

1.server端pom.xml<parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.1.1.RELEASE<...

2018-12-06 14:28:48 3110

原创 spring发送邮件附件显示名中文乱码的解决

原效果:处理代码在程序启动时设置:public static void main(String[] args) { //java mail发邮件是附件名过长默认会被截断,附件名显示【tcmime.29121.29517.50430.bin】,主动设为false可正常显示附件名 System.setProperty("mail.mime.splitlongparameters"...

2018-11-28 16:14:37 4229 1

原创 基于redis分布式锁实现quartz调度集群

要求:不使用quartz创建表。1.springboot工程,quartz创建job由spring管理,具体方式详见:quartz创建job由spring管理2.配置redis分布式锁,具体方式详见:配置redis分布式锁3.采用triggerListener来实现import org.quartz.JobExecutionContext;import org.quartz....

2018-11-22 19:48:21 3028

原创 实现redis分布式锁

springboot工程。redis哨兵1.配置redis模板import org.springframework.context.annotation.Bean;import org.springframework.context.annotation.Configuration;import org.springframework.data.redis.connection.je...

2018-11-22 19:38:07 744 1

转载 SpringBoot监听Redis的Key过期事件

原文链接:https://javaweb.io/post/198Redis的配置修改conf文件 notify-keyspace-events "Ex" 该配置表示监听key的过期事件,默认未开启 该配置的其他信息(可以监听N多事件),可以参阅配置文件的注释,非常详细自定义监听器该监听器会在key过期时候触发 import java.nio.charset.Sta...

2018-11-21 14:41:30 9272 3

原创 springboot整合使用Apollo配置中心

1.创建C:\opt\settings\server.properties目录,并填写内容【env=DEV】2.创建springboot 项目 版本1.5.17.RELEASE3.添加Apollo依赖<!--apollo相关jar包--><dependency> <groupId>com.ctrip.framework.apollo</g...

2018-11-15 21:47:41 16225 9

原创 update 结果集的优化

表记录条数:SELECT count(1) from db.table1原sql:UPDATE db.tableSET attr1 =1WHERE attr2 IN ( SELECT A.attr2 FROM ( SELECT attr2 FROM db.table WHERE attr3=3...

2018-11-15 15:50:41 437

原创 Apollo配置中心的安装

参考官方:https://github.com/ctripcorp/apollo/wiki/Quick-Start1.必要准备1.jdk版本1.8以上2.mysql 5.65+以上 Apollo的表结构对timestamp使用了多个default声明,所以需要5.6.5以上版本https://dev.mysql.com/downloads/file/?id=481117下载5....

2018-11-12 23:23:57 1554

原创 rabbitMQ学习之第一步hello world

安装启动rabbitMQ后,创建用户admin/123456 并给与administrator权限,virtual hosts设置为1<dependency> <groupId>com.rabbitmq</groupId> <artifactId>amqp-client</artifactId> <version>...

2018-11-08 22:39:42 163

原创 springboot整合thymeleaf学习

idea引导创建springboot项目,勾选依赖<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-thymeleaf</artifactId></dependency><depe...

2018-11-06 21:37:54 155

原创 记一次JDBC Connection [com.alibaba.druid.proxy.jdbc.ConnectionProxyImpl@274fdea6] will not be managed b

在springboot工程中:开启事物管理后执行发现Creating a new SqlSessionSqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@47e872bf] was not registered for synchronization because synchronization is not ...

2018-09-07 16:49:00 37402 10

原创 springboot 邮件发送

1.引入依赖<!--邮件发送--><dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-mail</artifactId></dependency>2.填写配置

2018-08-24 15:14:27 239

原创 springboot整合redis哨兵方式配置

1.springboot工程引入redis<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-redis</artifactId></dependency>2.applicat...

2018-08-24 14:53:53 21658 3

原创 记一次Optional导致的 java.util.NoSuchElementException: No value present

在跑任务的时候,代码Optional<CompanyComSizeBean> comSizeMaxCompanyComSizeBean = entrySet.getValue().stream() .filter(bean -> bean.getComSizeMax() >= finalComSizeMin) ...

2018-08-10 16:44:46 23917 4

原创 springboot config配置Scheduling

@EnableScheduling开启注解 @Schedules(value = { @Scheduled(cron = "0 15 0 1 * ?"), @Scheduled(cron = "0 15 0 15 * ?") }) @Scheduled(cron = "0 40 15 * * ?")在方法上配置执行表达式...

2018-08-10 15:41:04 670

原创 spring注解配置ehcache

spring采用注解方式配置ehcache2.x版本导入jar包: <dependency> <groupId>net.sf.ehcache</groupId> <artifactId>ehcache</artifactId> <version>2.7.2</version&

2018-07-30 15:11:41 684

原创 java config方式配置spring线程池

配置文件:thread.properties//线程池维护线程的最少数量spring.corePoolSize=5//允许的空闲时间spring.keepAliveSeconds=200//线程池维护线程的最大数量spring.maxPoolSize=10//缓存队列spring.queueCapacity=20代码:import org.springframework.beans....

2018-06-22 15:04:47 1987 2

原创 spring手动回滚事物

方法上加注解@Transactional(rollbackFor = { Exception.class })手动回滚事物try{ xxxMapper.saveXXX(saveXXX); if(true){ throw new Exception("保存xxx失败"); }}catch (Exception e){ //在catch异常中进行手动回滚 TransactionAspe...

2018-06-06 15:34:29 5095

原创 全局处理异常

import com.alibaba.fastjson.JSON;import com.google.common.collect.Maps;import org.slf4j.Logger;import org.slf4j.LoggerFactory;import org.springframework.web.bind.annotation.ControllerAdvice;impor...

2018-06-04 17:49:55 150

原创 spring注解方式配置redis哨兵

配置文件:#redis哨兵配置文件sentinel.host1=192.168.xx.xxsentinel.host2=192.168.xx.xxsentinel.port1=xxxxsentinel.port2=xxxxredis.password=xxxxredis.database=0redis.pool.maxTotal=500#最大能够保持idel状态的对象数...

2018-06-04 17:47:26 891

rabbitMQ3.7.8windows安装软件包

rabbitMQ windows 3.7.8安装软件包及erlang的安装软件包,及网上的安装教程

2018-11-08

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除