camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kevin-Void <>
Subject Dynamic URI based on file name/cfg file
Date Wed, 11 May 2016 16:20:47 GMT
Hi Folks,

I am trying to pass a *to URI value dynamically* with a property value. That
property value will be configured  already in the cfg file.

When the file name is extracted using *CamelFileNameOnly* header, it has to
get passed to the to Uri endpoint. So that the same name is referred in the

Please find my code below:

I have dropped a file with name *KevinFile.txt* in my server location=

*Config File*


*Camel Route*

<route id="awsRoute">
      <from uri="{{local.folder.url}}"/>
      <bean ref="processorClass" method="process"/>
      <log message="myProperty value is ${exchangeProperty.myProperty}"/>   
<---Gives the fileName
      <to uri="{{${exchangeProperty.myProperty}}}"/>       <--This is the
spot i am getting error :(


public class ProcessorClass implements Processor{
	public void process(Exchange exchange) throws Exception {
		String fileName = (String)
		exchange.setProperty("myPropertyNew", fileName);


Thanks in advance.


View this message in context:
Sent from the Camel Development mailing list archive at

View raw message