首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往
您找到你想要的搜索结果了吗?
是的
没有找到

@qualifier和@primary小记

作为正常人只能先去看一下是否可以删除其中一个jar包,发现这条路是走不通的只能去排除其中一个Bean了 这个就要讲到今天要说的两个注解了 @Qualifier 和 @Primary @qualifiel...@Primary Indicates that a bean should be given preference when multiple candidates are qualified to autowire...If exactly one ‘primary’ bean exists among the candidates, it will be the autowired value....This annotation is semantically equivalent to the {@code} element’s {@code primary} attribute 不难看出如果用...primary注解其中一个bean就要优先于其他的Bean,当然这个对于这种三方jar包最好不要添加的,谁知道它会不会后期又出什么幺蛾子,只能改自己的代码了最后的方案是改成@qualifiel(“getMetricRegistry

2.3K20
领券