Open dhaggart opened 4 years ago
We know the issue is down to the override defined in the metatype having a default of 0 -
com.ibm.ws.messaging.jms.common/resources/OSGI-INF/metatype/metatype.xml:
<OCD id="com.ibm.ws.jca.jmsQueue.properties.wasJms.javax.jms.Queue-com.ibm.ws.sib.api.jms.impl.JmsQueueImpl" ibm:extendsAlias="wasJms" ibm:extends="com.ibm.ws.jca.jmsQueue.properties" name="%properties.wasJms.Queue" description="%properties.wasJms.Queue.desc" >
...
<AD id="timeToLive" type="String" ibm:type="duration(s)" default="0s" min="0" name="%jms.common.timetolive" description="%jms.common.timetolive.desc" />
...
It is documented as a default time:
This is different to traditional WebSphere (affects porting):
where the property is null by default allowing the application to determine the setting. (i.e. it is an override value in WAS)
It behaves like it does in tWAS so perhaps the correct solution is to correct the documentation and not have a default value for it?
Using MessageProducer.send() to send a message with an explicit TTL value doesn't respect this and uses the queue defined TTL (default 0: no time-out) instead.
This is missed in the WS-CD com.ibm.ws.messaging.clientcontainer_fat 'testTimetoLiveVariation' FAT test (the result isn't reported). I'm in the process of porting this over to open-liberty which is where/why I've encountered it.
Simple reproduction:
Printing the message will show:
JMSExpiration: 0 JMSDestination: queue://QUEUE
If TTL is set to a fixed value in the client container's server.xml, e.g.
The message expires but if read in time and printed it shows, e.g.
JMSExpiration: 1574177165300 JMSDestination: queue://QUEUE_ONE?timeToLive=750
It is expected that the TTL value in the send() call be used and that the message expires before it can be consumed in the example.