【问题标题】:spring rabbitmq: can't set id as a property?spring rabbitmq:不能将 id 设置为属性?
【发布时间】:2014-11-20 13:43:01
【问题描述】:

我有一个属性文件,其中包含值为 queue_name 的队列

如果我在 other please 中使用该属性,那么它可以工作,但如果我在“id”上使用它,那么它会失败

<rabbit:queue id="${queue}" name="queue" />

错误是

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.amqp.rabbit.config.BindingFactoryBean#0': Cannot resolve reference to bean 'queue_name' while setting bean property 'destinationQueue'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'ConnectorInputQueue_silo' is defined.

更新: 我找到了以下日志:它说创建了bean ${queue},那么为什么不将${queue} 替换为“queue”的属性值?

2014-11-21 05:27:11 DEBUG DefaultListableBeanFactory:220 - Creating shared instance of singleton bean '${queue}'
2014-11-21 05:27:11 DEBUG DefaultListableBeanFactory:450 - Creating instance of bean '${queue}'
2014-11-21 05:27:11 DEBUG DefaultListableBeanFactory:524 - Eagerly caching bean '${queue}' to allow for resolving potential circular references
2014-11-21 05:27:11 DEBUG DefaultListableBeanFactory:478 - Finished creating instance of bean '${queue}'

【问题讨论】:

    标签: spring rabbitmq


    【解决方案1】:

    请显示更多信息以重现该问题。请注意您的 StackTrace 说:

    未定义名为“ConnectorInputQueue_silo”的 bean。

    也许它会以某种方式帮助你......

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-09-02
      • 2021-05-07
      • 1970-01-01
      • 2015-12-21
      • 2020-11-19
      • 2023-04-10
      • 1970-01-01
      相关资源
      最近更新 更多