Results 1 to 6 of 6

Thread: Spring Integration 'timestamp' overwrites JMSTimestamp

Hybrid View

  1. #1
    Join Date
    Dec 2010
    Location
    Tehran
    Posts
    48

    Question 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. #2
    Join Date
    Jan 2008
    Location
    Mohnton, PA USA (that's near Philadelphia)
    Posts
    2,148

    Default

    Looks like a bug. Could you please raise a JIRA issue: https://jira.springsource.org/browse/INT

  3. #3
    Join Date
    Oct 2005
    Location
    Boston, MA
    Posts
    2,853

    Default

    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 at 06:55 AM.

  4. #4
    Join Date
    Dec 2010
    Location
    Tehran
    Posts
    48

    Default

    In JMSMessage there is two 'timestamp', one that accessed through getJMSTimeStamp() method and other through
    getObejectProperty('timestamp').

    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. #5
    Join Date
    Dec 2010
    Location
    Tehran
    Posts
    48

    Default

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

  6. #6
    Join Date
    Oct 2005
    Location
    Boston, MA
    Posts
    2,853

    Default

    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.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •