Looks to me like the message is created with a header containing only id and timestamp to begin with:
2011-09-12 12:22:16,531 INFO [org.springframework.integration.file.FileReadingMe ssageSource] - Created message: [[Payload=c:\temp\scann\input\o.xml][Headers={timestamp=1315851728046, id=8c04ccd2-d334-45db-8241-755a652bc0bc}]]
So when I receive it in my FileToHandler.processFile it's already missing. I did some debugging and found that the message and the header are being created here:
Code:
public GenericMessage(T payload, Map<String, Object> headers) {
Assert.notNull(payload, "payload must not be null");
if (headers == null) {
headers = new HashMap<String, Object>();
}
else {
headers = new HashMap<String, Object>(headers);
}
this.headers = new MessageHeaders(headers);
this.payload = payload;
}
Code:
public MessageHeaders(Map<String, Object> headers) {
this.headers = (headers != null) ? new HashMap<String, Object>(headers) : new HashMap<String, Object>();
if (MessageHeaders.idGenerator == null){
this.headers.put(ID, UUID.randomUUID());
}
else {
this.headers.put(ID, MessageHeaders.idGenerator.generateId());
}
this.headers.put(TIMESTAMP, new Long(System.currentTimeMillis()));
}
Should the message be created somewhat different?