Hi All, For some reason the expression "${header.CamelFileName}" is not getting recoganised. I am tring to set my own file name to the output file.
Please can you ponit out if am missing something here. ProducerTemplate prod = exchange.getContext().createProducerTemplate(); for(ParsedDataBean data: tdrData){ //log.info("The size of processed data: "+data.getFileName()); exchange.getIn().setBody(data.getData()); String fileName = data.getFileName(); exchange.getIn().setHeader(Exchange.FILE_NAME,fileName); if(data.getSize() < batchSize){ log.info("The Batch of "+batchSize+" records is NOT complete"); exchange.getIn().setHeader(Exchange.BATCH_COMPLETE, false); prod.sendBody("seda:tempQueue",exchange.getIn().getBody()); } else { log.info("The Batch of "+batchSize+" records is complete"); exchange.getIn().setHeader(Exchange.BATCH_COMPLETE, true); prod.sendBody("file:C:\\camelProject\\data\\outbox\\tdr?fileName=${header.CamelFileName}.xml", exchange.getIn().getBody()); } } Thanks & regards, Ebe -- View this message in context: http://camel.465427.n5.nabble.com/using-header-CamelFileName-in-file-tp5052452p5052452.html Sent from the Camel - Users mailing list archive at Nabble.com.