spring rabbitmq:不能将 id 设置为属性? [英] spring rabbitmq: can't set id as a property?
问题描述
我有一个属性文件,其中包含值为 queue_name 的队列
I have a property file which contains queue whose value is queue_name
如果我在其他地方使用该属性,那么它可以工作,但是如果我在id"上使用它,那么它就失败了
If I use the property in other please, then it works, but if I used it on "id", then it failed
<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"的属性值?
update: I found the following log: it said bean ${queue} is created, so why didn't it replace ${queue} with the value of property of "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}'
推荐答案
请显示更多信息以重现该问题.并注意您的 StackTrace 说:
Show, please, more info to reproduce the issue. And pay attention that your StackTrace says:
未定义名为ConnectorInputQueue_silo"的 bean.
No bean named 'ConnectorInputQueue_silo' is defined.
也许它会以某种方式帮助你......
Maybe it will help you somehow...
这篇关于spring rabbitmq:不能将 id 设置为属性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!