Hi,

Just reporting this little "inconsistence" I've spot. 
Version used to test :
2.15.3 of camel, 1.7 Java.

Take this example : http://pastebin.com/0HrSt0iv
The Route 1 set the header CamelFileName to Transformed.txt, and the Route 2
to Transformed2.txt. The both are sent to a ZipAggregationStrategy with
"true" for useFilenameHeader.

However, in the Zip, only Message1.txt is renamed in Transformed.txt,
Message2.txt is zipped with the same name as before.

I've check for the reason, it seems it comes from that part in
ZipAggregationStrategy :
http://pastebin.com/95ckVD2c

In the case of a file polled exchange, the condition
GenericFileMessage.class.isAssignableFrom(newExchange.getIn().getClass()))
is matched and no useFilenameHeader is used. When I convert the exchange it
to byte[].class or even String.class, it trigger the else condition and the
file is well renamed in the archive.

I'm quite a beginner with camel, so it's possible I've missed something that
would explain that behaviour. But I found it quite strange and thought the
useFilenameHeader should always ensure that the filename will be changed
according to the header.

Have a nice day, and thank you all for that amazing framework,

Jonathan



--
View this message in context: 
http://camel.465427.n5.nabble.com/ZipAggregationStrategy-doesn-t-use-Header-for-polled-file-exchange-tp5771354.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to