'JMS with Oracle AQ. How to change delay of JMS Message when it's already in the queue?

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.enter image description here

Can I update delay during these 120 seconds while the message is still in the queue?

I do this through an sql query update 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



Solution 1:[1]

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.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Talijanac