I want to create spring bean like:
@Bean(name = {
"foo",
"bar",
"${foobar}"
})
public FooBarBean getFooBarBean(
where ${foobar} name will be resolved from application.yml or from environment value on application init phase.
I am not sure @Bean annotation supports variables from context so code sample only as example as it would be if it is would be possible.
How can I set bean name from environment variable value (without usnig xml declaration)?