[英]What means this JMS configuration into a Spring application?
I am studying how Spring framework handle JMS and I have the following doubt related this question founded on my study material. 我正在研究Spring框架如何处理JMS,并且在我的学习资料上有以下有关该问题的疑问。
Consider the following JMS configuration defined into a Spring application: 考虑在Spring应用程序中定义的以下JMS配置:
<jms:listener-container connetionFactory="connectionFactory">
<jms:listener-destination="order.queue" ref="orderListener" method="order" />
</jms:listener-container>
What exactly does this configuration? 此配置究竟是什么?
Now I know that a JMS connection is tipically obtained from a factory , so I think that it is configuring the factory that give me my JMS connection (is it right?) 现在,我知道通常是从工厂获得JMS连接的 ,所以我认为它正在配置为我提供JMS连接的工厂(是吗?)
But what exactly specify this line?: 但是到底是什么指定了这一行呢:
<jms:listener-destination="order.queue" ref="orderListener" method="order" />
Tnx TNX
That would be a Message-driven Bean-like in the plain Java EE world. 在普通的 Java EE世界中,这将类似于消息驱动的Bean。 Have a look here .
在这里看看。 By the way, the attribute is
destination="queue.name"
; 顺便说一句,该属性为
destination="queue.name"
; there is no such a thing like <jms:listener-destination="order.queue"...
没有像
<jms:listener-destination="order.queue"...
这样的东西<jms:listener-destination="order.queue"...
ref
points to a MessageListener
or Spring SessionAwareMessageListener
, this attribute may be omitted (this is why the latter two must implements the onMessage
method, and by convention this will be called) ref
指向MessageListener
或Spring SessionAwareMessageListener
,则可以省略此属性(这就是为什么后两个必须实现onMessage
方法的原因,并且按照惯例将其调用)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.