Spring注解Qualifier使用场景,并剖析在SpringCloud-Ribbon负载均衡组件中的应用
一、当Spring上下文中含有某个Bean的多个实例,可以指定获取某个实例:代码示例:@ConfigurationpublicclassMyTest{@Bean("myExample1")@QualifierMyExamplemyExample1(){returnnewMyExample("myExample1","InstancemyExample1");}@Bean("myExample2")