• 1 reply
  • Latest Post - ‏2012-04-06T04:44:40Z by GlenM
8 Posts

Pinned topic Cant set JMSExpiration header property when connecting to ActiveMQ instance

‏2012-04-04T18:44:33Z |
I have a WPS instance configured to talk to a ActiveMQ instance using JMS import bindings. I have configured the resource adapter in the WAS admin console using the AMQ 5.2 resource files and created the connection factory and queue jndi entities

With this configuration in place, I'm able to successfully put a message to the target ActiveMQ qeueue

Now I wish to set the JMSExpiration property on the outbound message, so that if the message is not picked up within the defined time, it should expire and get automatically deleted from the queue. For this I used a mediation module and used the JMS Header node to set the value for the JMSExpiration property. But when I test this service, the expiration value of the jms message on ActiveMQ always shows 0
How do I resolve this ??
  • GlenM
    8 Posts

    Re: Cant set JMSExpiration header property when connecting to ActiveMQ instance

    After a little bit of more analysis, found that the IBM infocenter has a clear mention that not all JMS header fields can be updated directly, while the ones like JMSType, JMSDestinationMode, JMSPriority and JMSCorrelationID can be updated from the JMS Header Setter node in the mediation module.

    Infocenter link --- _
    We don't have the ability to set JMSExpiration directly (in fact no JMS application can set this value), its calculated at the time a message is sent based on the "time to live" specified. The "time to live" for an async request is derived from the request expiration value set through a qualifier. So you'd need to use an asynchronous invocation qualifier as below and specify the request time to live there.
    This works correctly now and sets the JMSExpiration on the message put on an ActiveMQ queue