springboot
genghongsheng
非宁静无以致远
展开
-
springboot 自定义banner
提供三个连接:https://blog.csdn.net/c5113620/article/details/79037023https://www.cnblogs.com/whthomas/p/5268743.htmlhttp://www.mamicode.com/info-detail-1980374.html转载 2018-05-30 15:52:14 · 130 阅读 · 0 评论 -
springboot配置多数据源的两种方式
随着业务场景的复杂,单数据源已满足不了实际使用,多数源的配置成为了主流,笔者根据自己的项目经验总结了两种常用的多数据源配置方式,这里使用mybatis框架作为持久层,如何实现分享给大家|| 第①种:定义多个数据源连接,mybatis配置好不同的数据源映射不同的dao及domain,通常同一个数据源会放到一个package下,即此包下的dao接口全是查同一个数据源的数据;...原创 2019-07-03 16:55:47 · 612 阅读 · 0 评论 -
@ConfigurationProperties注入的字段为null
参考:https://www.jianshu.com/p/1bb95eb83ca6感谢作者分享!在springboot项目中使用@ConfigurationProperties时,发现注入的字段值全为null,确定配置文件没问题,后网上搜到解决方法,讲字段添加setter方法即可实现注入...原创 2019-05-23 12:27:50 · 3679 阅读 · 1 评论 -
springboot+gradle+docker发布(下)
上篇,讲解了如何使用gradle进行打包,本篇,重点来讲解发布既然是基于docker的,肯定得构建镜像: 1) 打基础镜像: 笔者的工程是基于dockerHub官方openjdk:8-jdk-alpine,贡献下Dockerfile吧:FROM docker.io/openjdk:8-jdk-alpineMAINTAINER "genghongsheng"E...原创 2019-05-05 16:32:34 · 349 阅读 · 0 评论 -
springboot+gradle+docker发布(上)
最近接到一份活,项目是基于gradle构建的springboot微服务,最后将工程发布至k8s上,这期间碰到一些问题和难题,今天记录于此,以作分享: 1) 首先,gradle在本人的机器上并没有安装,之前用的是maven,本人上家单位也用过gradle,所以最初拿到项目的时候也并不慌,ok言归正传,导入工程后,idea编译报错:这个错误,困扰了我很久,首先说下原由:...原创 2019-04-29 17:57:02 · 223 阅读 · 0 评论 -
mybatis foreach批量更新多条sql语句执行的问题
我的工程是springboot的,mybatis 批量更新mysql数据库,我的xml如下:<update id="updateBatch" parameterType="java.util.List"> <foreach collection="list" index="index" item="item" separator=";&qu原创 2018-12-11 16:45:48 · 378 阅读 · 1 评论 -
springboot同时提供webservice和restful
@Configurationpublic class CxfConfig { @Autowired @Qualifier(Bus.DEFAULT_BUS_ID) private SpringBus bus; @Autowired QueryService queryService; @Bean public ServletRegist...原创 2018-08-29 20:52:09 · 892 阅读 · 0 评论 -
springboot整合activemq完整示例
项目:maven里添加依赖:<!--activemq--><dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-activemq</artifactId></dependency&g原创 2018-07-06 16:49:45 · 2390 阅读 · 0 评论 -
springboot schedule定时任务多线程
springboot@scheduled启动的定时任务默认是单线程,为了满足现实生活中的使用场景,开启多个线程,方式如下:import org.springframework.context.annotation.Bean;import org.springframework.context.annotation.Configuration;import org.springframework...原创 2018-07-04 17:14:45 · 2003 阅读 · 1 评论 -
查看springboot定时任务执行时间
springboot集成了Quartz定时任务,我们只要加个@Scheduled注解,就可以很方便的使用了,现实生活中,可能会遇到这样一种情况:想看查看下定时任务执行的最近20、30、50条记录等,本文参考了一下连接的博客https://www.cnblogs.com/wulm/p/6923545.html首先,@Value("${schedule.corn.failReq}")S...原创 2018-07-17 11:34:19 · 927 阅读 · 0 评论 -
was cached in the local repository, resolution will not be reattempted until the update interval of
核实下springboot用的maven是搭建项目时自带的(maven3)还是使用自定义的,然后看环境变量是哪个,最后核对仓库中有无报错的依赖包原创 2018-06-01 18:37:27 · 284 阅读 · 0 评论 -
Spring Boot 入门- 启动加载(CommandLineRunner)
http://rensanning.iteye.com/blog/2363313转载 2018-06-01 10:39:14 · 161 阅读 · 0 评论 -
springboot2之hikari连接池
springboot2之后默认使用hikari连接池,好处有哪些呢?分享个连接:http://ju.outofmemory.cn/entry/353647转载 2018-06-01 10:28:40 · 2805 阅读 · 0 评论 -
springboot项目设置时区
在springboot启动类里添加如下代码: @PostConstruct void setDefaultTimezone() { TimeZone.setDefault(TimeZone.getTimeZone("Asia/Shanghai"));// TimeZone.setDefault(TimeZone.getTimeZone("GMT+8")); }...原创 2018-06-22 14:35:19 · 7996 阅读 · 1 评论 -
springboot用CXF动态调用webservice
axis搭建的webservice项目,<service name="HelloWorld" provider="java:RPC" style="document" use="literal"> <parameter name="className" value="example.HelloWorld"/> &原创 2018-05-31 12:25:57 · 602 阅读 · 0 评论 -
springboot搭建redis哨兵模式Sentinel
本文参考了https://www.jianshu.com/p/06ab9daf921d,在此感谢作者的分享! ①简介: redis哨兵模式是一种特殊的模式,首先Redis提供了哨兵的命令,哨兵是一个独立的进程,作为进程,它会独立运行。其原理是哨兵通过发送命令,等待Redis服务器响应,从而监控运行的多个Redis实例。这里的哨兵有两个作用 通过发送命令,让Redis服务...原创 2019-07-12 10:44:39 · 377 阅读 · 0 评论