MessageConsumer/MessageProducer 与 QueueSender/QueueReceiver

发布于 2024-11-19 13:52:42 字数 452 浏览 1 评论 0原文

MessageConsumer/MessageProducer 是否相当于 QueueSender/QueueReceiver 的 XA?

据我所知, MessageConsumer/MessageProducer 在 XA 上下文中使用效果更好。

在我的应用程序中,我想从 QueueConnectionFactoryQueueConnection、QueueSession 切换到它们的 XA 等效项,为此我需要使用 MessageConsumers/Receivers 而不是 QueueSendersQueueReceivers

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

暗藏城府 2024-11-26 13:52:42

MessageConsumer/MessageProducer 是否相当于 QueueSender/QueueReceiver 的 XA?

不会。QueueSender 扩展了MessageProducer,并提供了一些额外的特定于队列的方法。和XA没有关系。 QueueReceiverMessageConsumer 之间也存在相同的关系。

据我所知,MessageConsumer/MessageProducer 在 XA 上下文中使用效果更好。

再次强调,这与 XA 无关。通常最好在任何 JMS 代码中写入 MessageConsumer/MessageProducer 接口,除非您特别需要 QueueSender 提供的额外方法/队列接收器

在我的应用程序中,我想从QueueConnectionFactoryQueueConnectionQueueSession切换到它们的XA等效项,为此我需要使用MessageConsumers /Receivers 而不是 QueueSenders 和 QueueReceivers。

不会。你是否使用XA与你选择的API接口无关。 XA 行为由您​​从应用程序服务器获取的 QueueConnectionFactory 决定。大多数将为您提供 XA 或非 XA QueueConnectionFactory,通常位于不同的 JNDI 路径上,由您决定是否获取合适的路径。

一旦您拥有正确的QueueConnectionFactory,您的应用程序就不应该关心是否使用XA。

Is the MessageConsumer/MessageProducer the XA equivalent of QueueSender/QueueReceiver?

No. QueueSender extends MessageProducer, and provides some additional queue-specific methods. It has nothing to do with XA. The same relationship exists between QueueReceiver and MessageConsumer.

As far as I can understand the MessageConsumer/MessageProducer are better used in a XA context.

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 by QueueSender/QueueReceiver.

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.

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-XA QueueConnectionFactory, 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文