I am trying to implement a scenario which is as follows. Get all the files
from a location and zip the files and put the zip file to other location. It
is working fine put when I am trying to open the zip file, camel has changed
all the files name to default unique naming convention. I want the files
name not to be modified. I tried in many ways but couldn't achieve it. My
code looks as follows.
from(from).process(new Processor() {
RouteTerminator terminator;
@Override
public void process(Exchange exchange) throws Exception {
Object data = exchange.getIn().getHeader(
"CamelFileName");
logger.info("File Name for Archive Process" + data);
if (data == null) {
terminator = new RouteTerminator(routeId, exchange
.getContext());
terminator.start();
}
exchange.getIn().setHeader("CamelFileName", data);
}
}).aggregate(new ZipAggregationStrategy()).constant(true)
.completionFromBatchConsumer().eagerCheckCompletion()
.setHeader(Exchange.FILE_NAME, constant(generateFileName()))
.to(to).process(new Processor() {
RouteTerminator terminator;
@Override
public void process(Exchange exchange) throws Exception {
log.debug("RouteTerminator is called from
ServerArchiveFilesRoute to Stop the route");
terminator = new RouteTerminator(routeId, exchange
.getContext());
terminator.start();
}
}).routeId(routeId);
--
View this message in context:
http://camel.465427.n5.nabble.com/File-name-changed-when-Ziping-the-files-in-camel-tp5774234.html
Sent from the Camel - Users mailing list archive at Nabble.com.