spring
这儿很凉
后端开发
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
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 · 965 阅读 · 0 评论 -
笔记-配置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 · 1709 阅读 · 0 评论 -
springboot全局处理异常
1.先决条件:springboot默认异常路径/error2.访问http://localhost/user/get/-13.出错后,/error请求会映射到该controller 4.配置error页面,404,500及其它error页面5.配置其它青口请求过来的,如app段,处理异常返回 ...原创 2019-01-02 14:47:41 · 190 阅读 · 0 评论 -
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 · 632 阅读 · 0 评论 -
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 · 3197 阅读 · 0 评论 -
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 · 4418 阅读 · 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 · 3164 阅读 · 0 评论 -
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 · 2210 阅读 · 0 评论 -
记一次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 · 37964 阅读 · 10 评论 -
springboot 邮件发送
1.引入依赖<!--邮件发送--><dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-mail</artifactId></dependency>2.填写配置原创 2018-08-24 15:14:27 · 383 阅读 · 0 评论 -
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 · 21778 阅读 · 3 评论 -
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 · 752 阅读 · 0 评论 -
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 · 2130 阅读 · 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 · 5186 阅读 · 0 评论 -
全局处理异常
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 · 203 阅读 · 0 评论 -
笔记-使用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 · 1690 阅读 · 1 评论
分享