...
Code Block |
---|
from("file:input/directory?antInclude=*/.txt").marshal().zipFile().to("file:output/directory"); |
If there is no incoming CamelFileName
message header (for example, if the file component is not the consumer), then the message ID is used by default, and since the message ID is normally a unique generated ID, you will end up with filenames like ID-MACHINENAME-2443-1211718892437-1-0.zip
. If you want to override this behavior, then you can set the value of the CamelFileName
header explicitly in your route:
Code Block |
---|
from("direct:start").setHeader(Exchange.FILE_NAME, constant("report.txt")).marshal().zipFile().to("file:output/directory"); |
Unmarshal
In this example we unmarshal a Zip file payload from an ActiveMQ queue called MY_QUEUE to its original format, and forward it for processing to the UnZippedMessageProcessor
.
...