在使用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 boot 配合yaml @Value失败

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

就可以啦

相关文章:

  • 2021-06-18
  • 2022-02-09
  • 2021-12-08
  • 2022-12-23
  • 2022-02-08
  • 2022-12-23
  • 2021-04-18
猜你喜欢
  • 2022-12-23
  • 2021-09-20
  • 2021-07-16
  • 2022-12-23
  • 2021-12-19
  • 2021-07-16
  • 2022-12-23
相关资源
相似解决方案