springboot
小强聊it
7年+互联网和金融技术人,个人微信:xiaoqiang666it,公众号:小强聊it,欢迎一起聊聊专注在技术、成长和AIGC的内容。
展开
-
springboot的actuator
微服务的特点决定了功能模块的部署是分布式的,大部分功能模块都是运行在不同的机器上,彼此通过服务调用进行交互,前后台的业务流会经过很多个微服务的处理和传递,出现了异常如何快速定位是哪个环节出现了问题?在这种框架下,微服务的监控显得尤为重要。Spring Boot Actuator 模块提供了生产级别的监控功能,比如健康检查,审计,指标收集,HTTP 跟踪等,帮助我们监控和管理Spring Boot 应用。这个模块是一个采集应用内部信息暴露给外部的模块,上述的功能都可以通过HTTP 和 JMX 访问。原创 2024-01-25 15:36:49 · 1280 阅读 · 0 评论 -
springboot单类集中定义线程池
1、在启动类上加注解 @EnableAsync2、定义线程池的类package com.javabase.Thread;import com.google.common.util.concurrent.ThreadFactoryBuilder;import java.util.concurrent.*;public class EventThreadPool extends ThreadPoolExecutor { /** * 定义线程工厂名称 */ .原创 2021-01-20 13:49:24 · 234 阅读 · 2 评论 -
cron表达式详解
1、https://blog.csdn.net/gm371200587/article/details/82657935和定时任务的其他写法:https://blog.csdn.net/wqh8522/article/details/792242902、使用spring@Schedule注解定时任务时将时间表达式写入配置文件中的方法:https://blog.csdn.net/SilenceBiuBiu/article/details/72123746...转载 2020-05-26 20:15:39 · 112 阅读 · 0 评论 -
Spring RestTemplate中几种常见的请求方式
感谢:https://mp.weixin.qq.com/s?__biz=MzI1NDY0MTkzNQ==&mid=2247483941&idx=1&sn=6a86e429f704e900987a470709a94159&scene=21#wechat_redirect转载 2020-05-21 06:45:10 · 141 阅读 · 0 评论 -
初探RestTemplate--postForObject方法直接传递对象
感谢:https://blog.csdn.net/mryang125/article/details/80955558转载 2020-05-21 06:40:56 · 516 阅读 · 0 评论 -
SpringBoot项目构建成jar运行后,如何正确读取resource下的文件
感谢:https://blog.csdn.net/hero272285642/article/details/85119778转载 2020-05-21 06:39:24 · 270 阅读 · 0 评论 -
Spring中的InitializingBean接口的使用
感谢:https://www.cnblogs.com/weiqihome/p/8922937.html转载 2020-05-21 06:38:35 · 106 阅读 · 0 评论 -
Spring Boot之 Controller 接收参数和返回数据总结
感谢:https://blog.csdn.net/jy02268879/article/details/82830789转载 2020-05-20 23:39:21 · 712 阅读 · 0 评论 -
springboot的RESTful API的设计
感谢:https://blog.csdn.net/qq_32101993/article/details/85058253转载 2020-05-20 23:38:30 · 114 阅读 · 0 评论 -
springboot的配置文件的优先级
感谢:https://m.imooc.com/article/23670转载 2020-05-20 23:36:43 · 138 阅读 · 0 评论 -
整合阿里druid数据库连接池
https://blog.csdn.net/CoffeeAndIce/article/details/78707819转载 2020-05-20 23:35:13 · 147 阅读 · 0 评论 -
springboot集成log4j2
感谢:https://blog.csdn.net/qqHJQS/article/details/74095143转载 2020-05-20 23:34:11 · 91 阅读 · 0 评论 -
统一异常处理ControllerAdvice
感谢:https://www.cnblogs.com/magicalSam/p/7198420.html 和https://www.cnblogs.com/donghang/p/9233653.html 和https://www.cnblogs.com/chenss15060100790/p/9095584.html和https://blog.csdn.net/qq_22860341/article/details/81222379 和https://blog.csdn.net/k...转载 2020-05-20 23:31:56 · 90 阅读 · 0 评论 -
spring的aop与拦截器
1、spring的aop:https://www.cnblogs.com/softidea/p/6123307.html2、拦截器涉及的JoinPoint 的用法:https://blog.csdn.net/qq_15037231/article/details/80624064 和https://www.cnblogs.com/softidea/p/6123307.htm转载 2020-05-18 21:22:40 · 155 阅读 · 0 评论 -
java使用枚举封装错误码及错误信息
1、Java生鲜电商平台-统一格式返回的API架构设计与实战:https://www.cnblogs.com/jurendage/p/11982149.html2、java使用枚举封装错误码及错误信息:https://blog.csdn.net/dream_lixiang/article/details/549257603、RequestBodyAdvice和ResponseBodyAdvice:https://blog.csdn.net/qq_16504067/article/details/7.转载 2020-05-18 21:18:57 · 1467 阅读 · 1 评论 -
SpringBoot三招组合拳,手把手教你打出优雅的后端接口
https://www.jianshu.com/p/b5b8613769db转载 2020-05-16 10:34:56 · 99 阅读 · 0 评论 -
springboot分组检验
1、在jsronrpc里面用法1、1在实体类中定义 @NotNull(message = "协议版本号不能为空",groups ={Save.class,Query.class} ) private Integer agreement_version; public interface Save { } public interface Query { ...原创 2020-04-23 06:26:57 · 356 阅读 · 0 评论 -
DependsOn注解
DependsOn注解可以让我们在某个bean依赖另外一个bean的时候先加载另外一个bean,如下在控制台可以看到b类先被注入package com.testGetBean;import org.slf4j.Logger;import org.slf4j.LoggerFactory;import org.springframework.context.annotation.Depe...原创 2020-04-18 16:53:09 · 3386 阅读 · 0 评论 -
spring单元测试
https://blog.csdn.net/qq_41354631/article/details/90230173转载 2020-03-29 08:56:45 · 106 阅读 · 0 评论 -
对java.lang.ExceptionInInitializerError理解和解决办法
知识点:静态代码块和静态变量是随着类的加载而加载的,静态变量的加载顺序是按照静态变量声明的位置开始的。所以报这个异常的原因有两个:1.类的静态变量未初始化就被调用。这个问题出现在使用单例模式时,那个类里面还有静态变量,根据静态变量的加载顺序是按照静态变量声明的位置开始的这个语法,静态变量的初始化写在了instance实例初始化之后导致的,检查静态变量初始化的顺序即可。2.就是类的静态变量或...转载 2020-03-29 08:46:24 · 3911 阅读 · 0 评论 -
SpringBoot数据库连接池常用配置
https://www.cnblogs.com/gslblog/p/7169481.html转载 2020-01-03 08:07:13 · 410 阅读 · 1 评论 -
Springboot mybatis generate 自动生成实体类和Mapper 以及Example的实例函数及详解
https://blog.csdn.net/xintingandzhouyang/article/details/80599987和https://blog.csdn.net/biandous/article/details/65630783转载 2020-01-02 08:22:00 · 1035 阅读 · 0 评论 -
postman传递list参数给Springboot的controller
代码列表是这样的: public Object addTag(@RequestBody List<Tag> tags){ return tagService.batchAddTag(tags); } 在post里面应该这样传递[ { "tagName": "Bill" }, ...原创 2020-01-01 10:24:07 · 510 阅读 · 0 评论 -
SpringCloud框架
1、SpringCloud微服务框架搭建:https://www.cnblogs.com/springboot/p/8445780.html2、springcloud框架中文官网:https://springcloud.cc/3、springboot框架官网:http://spring.io/projects/spring-boot4、教程:https://blog.cs...转载 2018-12-23 22:03:56 · 149 阅读 · 0 评论 -
springboot和mvc使用过滤器和拦截器
拦截器之HandlerInterceptor:1、springboot:https://www.cnblogs.com/jwentest/p/9497591.html2、springMVC :https://www.cnblogs.com/zp-uestc/p/8966889.html拦截器之MethodInterceptor:1、https://blog.csdn.net/u...转载 2019-06-25 16:52:03 · 257 阅读 · 0 评论 -
spriing boot 启动报错:Cannot determine embedded database driver class for database type NONE
https://www.cnblogs.com/yql1986/p/6819097.html转载 2019-07-10 08:57:45 · 126 阅读 · 0 评论 -
springboot项目打印方法调用耗时、json化log和打印traceID
1、打印traceId :https://blog.csdn.net/qq_25646191/article/details/81004852其中涉及的添加springboot项目加过滤器:https://www.cnblogs.com/begin2016/p/8947887.htmlhttps://blog.csdn.net/yangcheng33/article/details/80...转载 2019-07-24 17:25:59 · 1392 阅读 · 0 评论 -
关于post请求体参数的三部分:body,header,query
https://blog.csdn.net/yunxuantu/article/details/83045810转载 2019-08-24 22:54:45 · 2917 阅读 · 0 评论 -
Spring Boot配置Servlet,Filter,Listener,Interceptor
https://blog.csdn.net/m0_37546724/article/details/78163408转载 2019-08-22 15:27:50 · 115 阅读 · 0 评论 -
Spring 异步和定时使用方法总结
https://www.cnblogs.com/duanxz/p/6782847.html 和https://www.cnblogs.com/duanxz/p/6782933.html转载 2019-08-18 12:39:33 · 136 阅读 · 0 评论 -
spring中Constructor、@Autowired、@PostConstruct的顺序
其实从依赖注入的字面意思就可以知道,要将对象p注入到对象a,那么首先就必须得生成对象p与对象a,才能执行注入。所以,如果一个类A中有个成员变量p被@Autowired注解,那么@Autowired注入是发生在A的构造方法执行完之后的。如果想在生成对象时候完成某些初始化操作,而偏偏这些初始化操作又依赖于依赖注入,那么就无法在构造函数中实现。为此,可以使用@PostConstruct注解一个方法来...转载 2019-08-18 12:43:07 · 426 阅读 · 0 评论 -
@EnableAutoConfiguration和@SpringbootApplication注解
https://www.cnblogs.com/xuwenjin/p/8822820.html转载 2019-08-18 12:51:50 · 120 阅读 · 0 评论 -
springboot整合定时框架-Elastic-job-lite
本文链接:https://blog.csdn.net/qq_31673689/article/details/80245593githup地址:https://github.com/MiChongGET/elastic-job————————————————版权声明:本文为CSDN博主「Mi_Chong」的原创文章,遵循CC 4.0 by-sa版权协议,转载请附上原文出处链接及本声明。...转载 2019-08-26 12:06:58 · 125 阅读 · 0 评论 -
springboot教程
1、纯洁的微笑:https://www.cnblogs.com/ityouknow/p/5662753.html2、ControllerAdvice:https://www.cnblogs.com/magicalSam/p/7198420.html 和https://www.cnblogs.com/donghang/p/9233653.html 和https://www.cnblogs....转载 2019-08-26 23:37:23 · 87 阅读 · 0 评论