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 的负载保护

相关推荐
咖啡八杯1 天前
GoF设计模式——策略模式
java·后端·spring·设计模式
java小白小1 天前
SpringBoot(01): 初识SpringBoot,从Spring的痛点说起
spring boot
用户128526116021 天前
我把祖传Java项目重构后,接口响应从3s砍到了200ms,只改了这几行代码
java
Linsk1 天前
组件 = 模板 + 业务逻辑
java·前端·vue.js
星沉远浦1 天前
用Gemini高效解决Java代码报错难以定位的问题
java
用户3169353811831 天前
如何从零编写一个 Spring Boot Starter
spring boot
用户298698530141 天前
Word 文档字符级格式化:Java 实现方案详解
java·后端
笨鸟飞不快1 天前
从单个服务到集群:一次完整的性能排查复盘
java·前端
荣码2 天前
用Streamlit给AI应用套个界面,10行代码出Web页面
java·python
SamDeepThinking2 天前
Java微服务练习方式
java·后端·微服务