Hi all,
it's something similar to https://communities.ca.com/message/241989384-how-to-set-a-response-jms-message-property-with-the-value-from-a-request-jms-message-property
but it's a different need anyway:
I'm working on a JMS communication based service where messages have headers, properties and xml body.
The service receives a message from a queue, creates a response xml and sends the message (with other headers and properties) on another queue.
How could I set a new property on the response that is equal to the response JMS Timestamp header itself (msg.timestamp)?
Something similar to msg.props.myTimestamp = {{=msg.timestamp}}.
So I need msg.props.myTimestamp be exactly equal to msg.timestamp, but just to know: how could I set msg.props.myTimestamp to current timestamp in milliseconds?
I've tried all the following ways without good results:
- timestamp.getTime()
- date.getTime()
- System.currentTimeInMillis().
Thank you and
Best Regards,
Alessandro.
According to the JMS specification, the JMSTimestamp header is always set by the JMS provider at the time a message is published. The sender has no control over the value of this header.
From section 3.4.4:
Unless you're using a JMS provider that does not follow the spec, what you're asking is impossible.