Given spring java-config with method that returns list of beans:
@Configuration
public class Config {
@Bean(name = "resultConsumers")
public List<Consumer> getConsumers() {
return Arrays.asList(...);
}
}
How can I inject it in another bean?
class Bean {
@Inject
what?
}
P.S. It is not list with different implementations of consumers, they are all instances of the same class.
And the injection is like this
And that's all.