In Spring XML, I can use the alias
element to assign one or more aliases to a bean. I'm wondering if there is a Spring Boot programmatic way to do the same?
The use case is I have legacy code that needs a JMS TopicConnectionFactory
. Using Spring Boot's ActiveMQ auto configuration, I get a TopicConnectionFactory
automatically. However, the legacy code uses a static string to lookup the bean name, so I need to create an alias that links the legacy code bean lookup to the Spring Boot bean.
I have tried looking at BeanDefinitionCustomizer
but it doesn't have a way to set alias or bean name.