Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Oracle 12 AQ JMS time to live does not accept values greater than cca 24 days

Alison GoebJul 12 2022

Oracle AQ - JMS time to live does not accept values greater than cca 24 days.
We are using aqapi.jar v12.1.0.2 to work with Oracle AQ (Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit).
We found that setting message's expiration time (TTL) greater than 24 days using the JMS API (calling oracle.jms.AQjmsProducer.send(Message message, int deliveryMode, int priority, long timeToLive)) is not possible because given TTL is casted from long to int type before dividing it by 1000.
If we set TLL to a value greater than 24 days, the number overflow occurs and is resulting in an error (if the final value is negative) or is continuing with wrong value. We did not find any documentation about the maximum allowed value of TTL and that's why we expected that the maximum value is given by parameter type of AQjmsProducer.send() - long java type.
Casting is done in AQjmsProducer.jdbcEnqueue()/jdbcEnqueueSh() internal method by this (decompiled) code snippet:
int k = 0;
if(l == 0L || l == -1L)
k = -1;
else
k = (int)l / 1000;
It is clearly seen that casting from long to int is done before dividing by line k = (int)l / 1000;. This way we are limited to use max. 24 days for TTL instead of 24000 days (if dividing before casting would be used: k = (int)(l / 1000)
.
Our business is blocked because we need to set messages' expiration to 30 days.
wink.png

Comments
Post Details
Added on Jul 12 2022
0 comments
348 views