![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
spring
文章平均质量分 62
chenkangck50
这个作者很懒,什么都没留下…
展开
-
如何在Spring Boot中集成RabbitMQ
在Spring Boot集成的RabbitMQ应用中,通常会在消费者处理消息时发生异常的情况下,明确地将消息发送到死信队列。如果点进来,没有显示这个绑定队列,就说明配置的不对,后续也无法消费,点进队列后,就会显示队列中的消息了。避免消息丢失:死信队列确保无法处理的消息不会被丢失,而是存储在一个特定的地方,供进一步的检查和处理。队列达到最大长度:如果队列设置了最大长度并达到这个限制,最老的消息可能会被移动到死信队列。在这个例子中,如果在处理消息的过程中发生异常,消息会被明确地拒绝,并发送到配置的死信队列。原创 2023-12-07 19:40:29 · 1134 阅读 · 2 评论 -
Redis 发布订阅机制深入探索
Redis 的发布订阅(pub/sub)机制是一种消息传递模式原创 2023-11-29 18:08:57 · 333 阅读 · 0 评论 -
spring bean的三级缓存原理
spring bean 三级缓存原理原创 2023-04-18 15:20:36 · 2041 阅读 · 0 评论 -
Spring IOC 和 AOP 的原理
spring IOC 和AOP原理原创 2023-04-18 13:37:28 · 283 阅读 · 0 评论 -
feign客户端get请求,服务端抛出Method Not Allowed: Request method ‘POST‘ not supported
feign调用失败原创 2023-02-28 17:57:55 · 1268 阅读 · 0 评论 -
liunx 部署 kkfileview文件预览 以及解决https访问
https 请求下 kkfileview原创 2022-12-07 18:09:08 · 3321 阅读 · 10 评论 -
Spring @ConfigurationProperties
@ConfigurationProperties翻译 2022-09-15 14:53:21 · 268 阅读 · 0 评论 -
设计模式-行为模式-状态模式 以及spring 状态机
状态模式用于解决系统中复杂对象的状态转换以及不同状态下行为的封装问题系统中某个对象存在多个状态,这些状态之间可以进行转换,而且对象在不同状态下行为不相同时可以使用状态模式。状态模式将一个对象的状态从该对象中分离出来,封装到专门的状态类中,使得对象状态可以灵活变化,对于客户端而言,无须关心对象状态的转换以及对象所处的当前状态,无论对于何种状态的对象,客户端都可以一致处理状态模式定义如下:状态模式(State Pattern):允许一个对象在其内部状态改变时改变它的行为,对象看起来似乎修改了它的类Con原创 2022-02-22 10:17:43 · 796 阅读 · 0 评论 -
@ControllerAdvice源码解析
在bean 初始化后RequestMappingHandlerAdapterpublic void afterPropertiesSet() { // 初始化controllerAdvice this.initControllerAdviceCache(); List handlers; if (this.argumentResolvers == null) { handlers = this.getDefaultArgumentResolvers();原创 2022-01-18 08:38:16 · 503 阅读 · 1 评论 -
spring mvc的执行流程源码分析
前面介绍了http请求如何达到servlet的,下面分析下dispatcherServlet就知道spring mvc的执行流程了,还是从上面的 doDispatch开始protected void doDispatch(HttpServletRequest request, HttpServletResponse response) throws Exception { HttpServletRequest processedRequest = request; HandlerExec原创 2022-01-15 16:39:33 · 130 阅读 · 0 评论 -
spring mvc的拦截器源码分析
上面说了dispatcher servlet的执行流程源码,现在分析下拦截器的源码首先看下自己的的interceptor ,然后还需要将inerceptor注册到WebMvcConfigurer中实现package com.example.demo.config;import org.springframework.context.annotation.Configuration;import org.springframework.lang.Nullable;import org.sprin原创 2022-01-15 16:24:54 · 1013 阅读 · 0 评论 -
http请求是如何到达dispatcherServlet 源码解析
首先spring boot 内置了 tomcat服务器:‘<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId></dependency>当服务启动tomcat开启监听,他监听了端口,请求过来后,根据url等信息,确定要将请求交给哪个servlet去处理;原创 2022-01-10 15:57:00 · 1017 阅读 · 0 评论 -
springboot的自动装配源码
再走下springboot的自动装配原理:package org.jeecg.monitor;import de.codecentric.boot.admin.server.config.EnableAdminServer;import org.springframework.boot.SpringApplication;import org.springframework.boot.autoconfigure.SpringBootApplication;/** * 监控服务 */@Sp原创 2021-12-27 11:11:14 · 344 阅读 · 0 评论 -
spring缓存注解源码分析:@Cacheable @CacheEvict @CachePut
解决存入redis乱码package com.example.demo.kang.config;import org.springframework.beans.factory.annotation.Value;import org.springframework.boot.autoconfigure.cache.CacheProperties;import org.springframework.context.annotation.Bean;import org.springframewor原创 2021-12-07 17:07:38 · 1584 阅读 · 0 评论 -
Spring 中的bean 是线程安全的吗?
Spring 中的bean 默认情况下是单例模式 不安全先了解下bean(scope)的作用域1、singleton:单例,默认作用域。2、prototype:原型,每次创建一个新对象。3、request:请求,每次Http请求创建一个新对象,适用于WebApplicationContext环境下。4、session:会话,同一个会话共享一个实例,不同会话使用不用的实例。5、global-session:全局会话,所有会话共享一个实例。此次只讨论单例模式,测试如下package com原创 2021-11-26 17:10:24 · 696 阅读 · 3 评论 -
springboot 解决CORS跨域问题
1.实现Filter```javapackage com.github.binarywang.demo.wx.mp.config;import org.springframework.context.annotation.Configuration;import javax.servlet.*;import javax.servlet.annotation.WebFilter;import javax.servlet.http.HttpServletResponse;import jav原创 2021-10-22 09:48:56 · 97 阅读 · 0 评论