我在类级别上有一个注释,如果可以在外部配置它将会很棒
@QueueBinding(
value = @Queue(value = "acme", durable = "true", autoDelete = "false"),
exchange = @Exchange(type=ExchangeTypes.TOPIC, value = "corp", durable = "true", autoDelete = "false"),
key = "event.foo"
)
有没有办法外部化配置并使用弹簧配置属性?我想替换:
exchange = @Exchange(type=ExchangeTypes.TOPIC, value = "corp", durable = "true", autoDelete = "false")
使用我可在外部配置 value =“corp”
的版本我尝试了几种组合:
exchange = @Exchange(type=ExchangeTypes.TOPIC, value = "${setting.value}", durable = "true", autoDelete = "false")
但这不起作用,关于如何在类级别注释中使用外化可配置属性的任何线索?