JMS 与 Oracle AQ。当 JMS 消息已在队列中时,如何更改它的延迟?
当 JMS 消息已经在队列中时,是否可以更改它的延迟?
当我通过 JMS 发送消息时,我设置了 jmsMessage.setIntProperty("JMS_OracleDelay", 120)
。然后这个jmsMessage就出现在sql表operation_queue_table中。
当消息仍在队列中时,我可以更新这 120 秒内的延迟吗?
我通过 sql 查询来完成此操作 更新操作队列表t set t.delay = ?其中 t.corrid = ?
但该消息仍在队列中,直到 120 秒过去后才消失
If is it possible change delay of JMS Message when it's already in the queue?
When I send message via JMS, I set jmsMessage.setIntProperty("JMS_OracleDelay", 120)
. Then this jmsMessage appears in sql table operation_queue_table.
Can I update delay during these 120 seconds while the message is still in the queue?
I do this through an sql queryupdate operation_queue_table t set t.delay = ? where t.corrid = ?
But the message is still in the queue until 120 seconds have elapsed and only then disappears
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
据我所知,提供的任何消息都不支持消息突变性,当然,JMS API不支持它。
您可以做的是通过使用特定的JMS选择器消费并发送具有相同内容和不同参数的新消息来删除该特定消息。
但是,这将非常慢,这会引起质疑您为什么根本使用消息传递。异步消息传递的总体想法是开火和忘记。如果您确实需要更新,请不要使用消息传递。鉴于这是Oracle AQ,也许您可以通过JDBC进行操作?我从未使用过甲骨文的那部分。
As far as I know message mutability is not supported by any message provided, and certainly it is not supported by JMS api.
What you can do is to remove that specific message by consuming it with specific JMS selector and sending a new message with a same content and different parameters.
However, this will be horribly slow and it brings to question why are you using messaging at all. The general idea of asynchronous messaging is to fire and forget. If you do need updates don't use messaging. Given that this is Oracle AQ, maybe you could do it over JDBC? I never used that part of Oracle.