spring 面试题

1.springboot自动装配

从 这个META-INF/spring-autoconfigure-metadata.properties加载文件

2.springbean 的生命周期

3.spring 如何解绝循环依赖

java 复制代码
private final Map<String, Object> earlySingletonObjects = new ConcurrentHashMap<>(16);
private final Map<String, Object> singletonObjects = new ConcurrentHashMap<>(256);
private final Map<String, ObjectFactory<?>> singletonFactories = new HashMap<>(16);

synchronized (this.singletonObjects) {
			Object singletonObject = this.singletonObjects.get(beanName);
			if (singletonObject == null) {
				beforeSingletonCreation(beanName);
				try {
					singletonObject = singletonFactory.getObject();
					newSingleton = true;
				}
				catch (IllegalStateException ex) {
					singletonObject = this.singletonObjects.get(beanName);

				}
				finally {
					afterSingletonCreation(beanName);
				}
				if (newSingleton) {
					addSingleton(beanName, singletonObject);
				}
			}
			return singletonObject;
		}
  1. spring cloud zuul 的类型

forward SendForwardFilter,SimpleHostRoutingFilter

pre PreDecorationFilter,FormBodyWrapperFilter,DebugFilter

post LocationRewriteFilter,SendErrorFilter,SendResponseFilter

5.spring cloud 的 eureka 的负载保护

相关推荐
tongyiixiaohuang几秒前
基于轻易云的数据集成,实现企业系统间灵活对接
java·前端·数据库
码农飞哥5 分钟前
从Java后端到AI应用开发,我这两年做了什么
java·开发语言·人工智能
阿丰资源5 分钟前
基于SpringBoot智能化体育馆管理系统(附源码+文档+数据库,一键运行)
数据库·spring boot·后端
大龄码农-涵哥7 分钟前
Spring Boot项目集成AI对话:使用Spring AI打造智能客服
人工智能·spring boot·spring
森林猿10 分钟前
IDEA-控制台乱码
java·ide·intellij-idea
A-Jie-Y10 分钟前
JAVA设计模式-工厂方法模式
java·设计模式
胡童嘉15 分钟前
C语言考研《谭浩强C语言》教材第一章理论+实践汇总
c语言·开发语言·考研
千云16 分钟前
问题排查报告:一次因元空间溢出导致的CPU飙升与接口超时
java·后端
初心未改HD17 分钟前
Go语言Slice切片底层原理深度解析
开发语言·golang
Full Stack Developme17 分钟前
MyBatis-Plus 注解教程
java·spring·mybatis