MessageConsumer/MessageProducer 与 QueueSender/QueueReceiver
MessageConsumer
/MessageProducer
是否相当于 QueueSender
/QueueReceiver
的 XA?
据我所知, MessageConsumer
/MessageProducer
在 XA 上下文中使用效果更好。
在我的应用程序中,我想从 QueueConnectionFactory
、QueueConnection
、QueueSession 切换到它们的 XA 等效项,为此我需要使用 MessageConsumers
/Receivers
而不是 QueueSenders
和 QueueReceivers
。
Is the MessageConsumer
/MessageProducer
the XA equivalent of QueueSender
/QueueReceiver
?
As far as I can understand the MessageConsumer
/MessageProducer
are better used in a XA context.
In my app I want to switch from QueueConnectionFactory
, QueueConnection
, QueueSession to their XA equivalent and for that I would need to use MessageConsumers
/Receivers
instead of QueueSenders
and QueueReceivers
.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不会。
QueueSender
扩展了MessageProducer
,并提供了一些额外的特定于队列的方法。和XA没有关系。QueueReceiver
和MessageConsumer
之间也存在相同的关系。再次强调,这与 XA 无关。通常最好在任何 JMS 代码中写入
MessageConsumer
/MessageProducer
接口,除非您特别需要QueueSender 提供的额外方法
/队列接收器
。不会。你是否使用XA与你选择的API接口无关。 XA 行为由您从应用程序服务器获取的
QueueConnectionFactory
决定。大多数将为您提供 XA 或非 XAQueueConnectionFactory
,通常位于不同的 JNDI 路径上,由您决定是否获取合适的路径。一旦您拥有正确的
QueueConnectionFactory
,您的应用程序就不应该关心是否使用XA。No.
QueueSender
extendsMessageProducer
, and provides some additional queue-specific methods. It has nothing to do with XA. The same relationship exists betweenQueueReceiver
andMessageConsumer
.Again, this has nothing to do with XA. It's generally better to write to the
MessageConsumer
/MessageProducer
interfaces in any JMS code, unless you specifically need the extra methods provided byQueueSender
/QueueReceiver
.No. Whether you use XA or not has nothing to do with your choice of API interface. The XA behaviour is determined by which
QueueConnectionFactory
you obtain from the application server. Most will provide you with either an XA or a non-XAQueueConnectionFactory
, generally on a different JNDI path, and it is up to you to obtain the appropriate one.Once you have the correct
QueueConnectionFactory
, your application should not care whether XA is used or not.