We use JMS as a persistent temporary storage for later logging our Spring Integration messages into the database. Parts of message headers and payload are logged including a timestamp header. The problem is that this header is always set to current time after deserialization, since ChannelPublishingJmsMessageListener.onMessage method calls MessageBuilder.build method, which calls GenericMessage constructor, which then calls MessageHeaders and inside this constructor, this.headers.put(TIMESTAMP, new Long(System.currentTimeMillis())) is executed unconditionally. It means that there is no way to get the original timestamp when deserialized message was created.
Proposed solution is to modify MessageHeaders constructor so that timestamp is restored in the same way as message id.