Announcement Announcement Module
No announcement yet.
Spring Integration 'timestamp' overwrites JMSTimestamp Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring Integration 'timestamp' overwrites JMSTimestamp

    I use Spring Integration to connect ActiveMQ.
    I need a value of time of putting JMS message on queue (1).
    Here said 'JMSTimestamp' JMS property have above value.

    Really, 'timestamp' header have value of Spring Integration Message creation time (2) instead of above value.

    I see to code. In DefaultJmsHeaderMapper, 'timestamp' header is set by a JMS property with same name and (1) value.
    Then in MessageHeaders constructor, 'timestamp' header is overwited by current time value (ie (2) value).

    Is it a bug?
    If not, How can I access (1) value in Spring Integration?

  • #2
    Looks like a bug. Could you please raise a JIRA issue:


    • #3
      Just to clarify a bit, when we map from a JMS Message into a Spring Integration Message, we need to grab the JMSTimestamp property from the JMS Message and store it with its own key (which would be "jms_timestamp", also defined as a constant: JmsHeaders.TIMESTAMP). That way the Spring Integration timestamp and the JMS timestamp are kept separate.

      The "bug" is simply that we were not grabbing that property explicitly from a JMS Message. However, are you suggesting that you did see the JMSTimestamp's value being mapped into the header map with a key named "timestamp" *before* the actual Spring Integration Message was created? I would not have expected that to be the case.
      Last edited by Mark Fisher; Jan 17th, 2012, 06:55 AM.


      • #4
        In JMSMessage there is two 'timestamp', one that accessed through getJMSTimeStamp() method and other through

        These 2 timestamp has different values and I confused them before your comment. What is their difference?

        You catch the latter and put it in map with 'timestamp' key but when you use map of jms headers to build final Spring Integration Message headers map, ignore 'timestamp' value becuase 'timestamp' is a read-only Spring Integration header.

        Issue INT-2406 created.


        • #5
          Can I have a estimation of time this issue will be fixed (specially for 2.0.6)?


          • #6
            The 'timestamp' object property is the Spring Integration Message's timestamp, so that is separate from the JMSTimestamp property (which is essentially a built-in property of a JMS Message). We would continue to have the 'timestamp' object property, but the real bug is that we were not providing a way for you to access the JMSTimestamp via headers after mapping into a Spring Integration Message. So, our plan is to add that to the JMS properties that we do map. Does that make sense?

            I'm not so sure that we would backport this one to 2.0.6 actually. Do you have any idea when you would plan to upgrade to 2.1? (this will be addressed for 2.1.1).

            In the meantime, you should be able to reference your own implementation via the "header-mapper" attribute. So, you could copy our DefaultJmsHeaderMapper and modify it in a way similar to what we'll be doing.