Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: 1.3
-
Fix Version/s: None
-
Labels:None
-
Number of attachments :
Description
The "jmsExpiration" property on JmsProxyFactoryBean (which extends JmsClientInterceptor) is setting the request message's JMSExpiration header value in the populateHeaders() method of this class if its value is >= 0.
if (jmsExpiration >= 0)
{ requestMessage.setJMSExpiration(jmsExpiration); }And this is done before the message is sent via the JMS provider send() call. In the case of ActiveMQ, when the send() method of org.apache.activemq.ActiveMQSession is called, the JMSExpiration header value is always overridden with a value that depends on the MessageProducer's timeToLive value.
ActiveMQSession#send(ActiveMQMessageProducer producer, ActiveMQDestination destination, Message message, int deliveryMode,int priority, long timeToLive)
long expiration = 0L;
if (!producer.getDisableMessageTimestamp()) {
long timeStamp = System.currentTimeMillis();
message.setJMSTimestamp(timeStamp);
if (timeToLive > 0)
}
message.setJMSExpiration(expiration);
So it seems pointless to expose the jmsExpiration property on JmsProxyFactoryBean. Infact it was my understandign that client applications should not set JMSExpiration directly on the Message. They should use the timeToLive propert of the MessageProducer and before the JMS provider is sending the message, it calculated the JMSExpiration based on the timeToLive property and sets this header value. (And this is what the code above in ActiveMQSession appears to be doing).