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

相关推荐
小马爱打代码2 小时前
Redis Key 过期后会立刻删除吗?过期删除与内存淘汰策略详解
java·redis·缓存
Wonderful U2 小时前
基于Python+Django的在线题库与智能阅卷系统:从痛点分析到完整实现
开发语言·python·django
码语智行2 小时前
拦截器、接口限流、过滤器、防重发/幂等性功能说明
开发语言·网络·python
liulilittle2 小时前
麻将牌堆渲染(Lua)
开发语言·lua
鱼鳞_2 小时前
苍穹外卖-Day10(Spring task)
java·后端·spring
雨落在了我的手上2 小时前
初始java(十七):常⽤⼯具类介绍
java·开发语言
凤凰院凶涛QAQ2 小时前
《Java版数据结构 & 集合类剖析》集合框架的封装设计与顺序表:“从 Iterable 到 ArrayList:集合框架的‘职业树“
java·开发语言·数据结构
孟华苏2 小时前
怎么快速排查内存泄漏问题
java·开发语言·python
zz34572981132 小时前
C语言中字符串常量存储位置
c语言·开发语言·算法·青少年编程
noipp2 小时前
推荐题目:洛谷 P16510 [GKS 2015 #C] gRanks
java·c语言·开发语言·c++·python·算法