记录一次spring boot 配合yaml @Value失败
在使用spring-boot yaml配合@Value报了一下的错误:
yaml配置如下
content:
publish:
queue: xxm.community.business.content.publish.queue
exchange: xxm.community.article.publish.fanout.exchange
off:
queue: xxm.community.business.content.off.queue
exchange: xxm.community.article.off.fanout.exchange
后来debug发现
spring将off转义成了false,修改yaml为
content:
publish:
queue: xxm.community.business.content.publish.queue
exchange: xxm.community.article.publish.fanout.exchange
'off':
queue: xxm.community.business.content.off.queue
exchange: xxm.community.article.off.fanout.exchange
就可以啦