On Tue, Nov 29, 2016 at 8:03 PM, Steve973 <steve...@gmail.com> wrote:
> Oh, change the parentheses for your header expression to curly braces.
>

Yeah well spotted. The charset option ought to work on the producer side also.

> On Nov 29, 2016 10:36 AM, "morten" <morten.skou.niel...@gmail.com> wrote:
>
>> I am hoping to pass the encoding dynamically to a file component.
>> Basically I
>> need to store an error record in a file with the same encoding as the
>> inputfile (encoding is changed during processing). The original encoding is
>> stored in a header called inputFileEncoding here what i have tried:
>>
>> 1)
>> .recipientList(simple("file://" + outputDirectory + File.separator+
>> "?fileExist=Append&charset=$(header.inputFileEncoding)"));
>>
>> 2)
>> .toD("file://" + outputDirectory + File.separator +
>> "?fileExist=Append&charset=$(header.inputFileEncoding)");
>>
>> The problem is the file is not created. no exception i thrown. It does
>> works
>> when i hardcode the encoding like  charset="UTF8"
>>
>> a workaround has been to do:
>> exchange.setProperty(Exchange.CHARSET_NAME,inputFileEncoding) which seems
>> to
>> work.
>>
>> Is it not possible to set the encoding dynamically in the endpoint URI?
>>
>>
>>
>>
>>
>>
>>
>>
>> --
>> View this message in context: http://camel.465427.n5.nabble.
>> com/dynamic-endpoint-with-dynamic-encoding-tp5790768.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2

Reply via email to