I have a bean like this:
@Bean
public String myBean(){
return "My bean";
}
I want to autowire it:
@Autowired
@Qualifier("myBean")
public void setMyBean(String myBean){
this.myBean=myBean;
}
I need something like:
@Bean(name="myCustomBean")
Is it possible to use custom names names for beans out of the box? If it isn't possible out of the box then how to create such a bean?
What you are asking is already available in Spring 4.3.3