Is it possible to set name as a variable in springboot, like @Bean(name = "abc")? can we pass value of abc dynamically?

huangapple 未分类评论47阅读模式
英文:

Is it possible to set name as a variable in springboot, like @Bean(name = "abc")? can we pass value of abc dynamically?

问题

@Primary
@Bean(name = "business-test")
public DataSource dataSource() {
}

在这里我正在创建一个名为"business-test"的数据源但这个值应该来自另一个应用清单是否有可能实现这一点或者我们如何可以实现这一点
英文:
@Primary
@Bean(name = "business-test")
public DataSource dataSource() {
}

here I am creating a data source with bean name "business-test" but this value should come from another application manifest. is it possible to do so? or how can we achieve this?

huangapple
  • 本文由 发表于 2020年4月6日 16:00:29
  • 转载请务必保留本文链接:https://java.coder-hub.com/61055340.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定