确认来自 JMS 中不同通道/会话的消息

发布于 2024-09-15 01:33:10 字数 101 浏览 2 评论 0原文

我需要在与创建该消息的会话不同的会话中确认一条消息。如果所使用的消息在给定时间内未得到确认,则应将其添加回队列中。使用 JMS 是否可以实现这一点(计划使用 ActiveMQ 作为代理)。

I need a message to be Acknowledged in a different Session than the one it is created in. If the consumed message is not ACKed in a given time, it should be added back to the queue. Is this possible using JMS( planning to use ActiveMQ as the broker).

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

凶凌 2024-09-22 01:33:10

我认为这是不可能的。

如果消息被使用,应该由消费者会话确认(可以是自动确认或客户端确认)。确认是保证消息传递和事务机制的关键。 JMS 服务器使用确认来确保消息成功发送/使用。

关于超时问题,如果 JMS 服务器在给定时间段内没有收到确认,则通常会设置 JMSRedelivered 标志来重新传递消息。我不认为会这样将被添加回队列,然后能够被同一会话或另一个会话作为新消息使用。

I don't think it is possible.

If the message is consumed, it should be acknowledged by the consumer session (it can be auto or client acknowledgement). Acknowledgment is the key for guaranteed messaging and transaction mechanism. JMS server ensures the message is sent/consumed successfully using acknowledgement.

Regarding timeout question, if the JMS server didn't receive the ack in given time period, the message will be redelivered usually with JMSRedelivered flag set. I don't think it will be added back to the Queue then able to be consumed by same session or another session as a new message.

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