Autowiring two different beans of same class
You can combine @Autowired
with @Qualifier
, but in this case instead of @Autowired
, I suggest using @Resource
:
@Resource(name="jedisConnector")
JedisConnector beanA;
@Resource(name="jedisConnectorPOD")
JedisConnector beanB;
or even simpler:
@Resource
JedisConnector jedisConnector;
@Resource
JedisConnector jedisConnectorPOD;
@Autowired
@Qualifier("jedisConnector")
JedisConnector beanA;
@Autowired
@Qualifier("jedisConnectorPOD")
JedisConnector beanB;