You can try to specify beanio as a <bean> where you configure the
charset via <property> - then its a <bean> style where you specify the
FQN class name and all that stuff.
Then you should be able to setup the encoding as a java....Charset type.

The <bean> <property> stuff may be a bit cumbersome to get right, but
it ought to be possible.

Then you can refer to the bean via <marshal ref="xxx"/> where xxx is
the bean id.

The FQN class would be the beanio dataformat class you can find in the
camel-beanio JAR file.

On Thu, Feb 22, 2018 at 4:16 PM,  <> wrote:
> I tried all possible to set CamelCharsetName property/header/whatever
> manually, in hope it would be used by beanio, but it doesn't work.
> I even tried to convert body to ISO-8859-2, which is single byte character
> representation, but whatever I try, unmarshalling fixed length stream with
> beanio fails
> as soon as there are diacritic characters in a message, otherwise it is
> OK.
>         <route id="simple-route">
>             <from id="request-file" uri="
> file://C:/mqdocuments/?fileName=request.txt"/>
>             <log id="route-log-request" message="request: ${body}"/>
>             <setHeader headerName="CamelJmsDestinationName"
> id="_setHeader1">
>                 <constant>queue://QM_TEST/INPUTQ?targetClient=1</constant>
>             </setHeader>
>             <to id="_to1" pattern="InOut"
> uri="websphere:queue:SYSTEM.DEFAULT.LOCAL.QUEUE?useMessageIDAsCorrelationID=true&amp;replyTo=REPLYQ"/>
>             <log id="route-log-response" message="response body:
> ${body}"/>
>             <setHeader headerName="CamelCharsetName" id="_setHeader2">
>                 <constant>UTF-8</constant>
>             </setHeader>
>             <setProperty id="_setProperty1"
> propertyName="CamelCharsetName">
>                 <constant>UTF-8</constant>
>             </setProperty>
>             <!-- convertBodyTo charset="ISO-8859-2" id="_convertBodyTo1"
> type="java.lang.String"/-->
>             <!-- log id="route-log-response_CONVERTED" message="response
> body_CONVERTED: ${body}"/-->
>             <log id="route-log-response1" message="response
> header.CamelCharsetName: ${header.CamelCharsetName}"/>
>             <log id="route-log-response2" message="response
> property.CamelCharsetName: ${property.CamelCharsetName}"/>
>             <log id="route-log-response3" message="response
> ${}"/>
>             <unmarshal id="_unmarshal1" ref="some_bean_id"/>
>             <marshal id="_marshal1" ref="jack"/>
>             <log id="route-log-json" message="jackson: ${body}"/>
>         </route>
> This excludes everything but the first suggestion from the web as a
> possible solution with beanio, I may use something else, or get Red Hat
> support to utilize your fix.
> Hrvoje Đurđević
> Specijalist
> IT
> Raiffeisenbank Austria d.d.
> Magazinska cesta 69/2, 10000 Zagreb
> Tel. +385 1 4695 022
> Fax. +385 1 4604 907
> Mob. +385 98 416 032
> ______________________
> Napomena:
> Ova elektronička poruka i njeni prilozi mogu sadržavati povjerljive i/ili 
> povlaštene informacije, a namijenjena je isključivo za upotrebu naznačenog 
> primatelja. Ako ste ovu poruku primili greškom, molimo Vas da o tome bez 
> odlaganja obavijestite pošiljatelja, da uništite izvornu poruku i njene 
> priloge i bez odlaganja poruku i njene priloge izbrišete iz Vašeg sistema. 
> Neovlaštena uporaba, distribucija, otkrivanje, umnožavanje ili izmjena ove 
> poruke je zabranjena. Raiffeisenbank Austria d.d. ne daje niti ne prihvaća 
> pravno obvezujuće izjave putem elektroničkih poruka osim ukoliko drugačije 
> nije izričito navedeno. Budući da komunikacija internetom nije zaštićena, 
> Raiffeisenbank Austria d.d. ne prihvaća odgovornost za sadržaj ove poruke, 
> kao ni za eventualnu štetu nastalu zbog zaraženosti ove poruke virusom ili 
> drugim štetnim programom, te zbog eventualnih tehničkih problema prilikom 
> dostave ove poruke.
> Disclaimer:
> This e-mail message and any attachment may contain confidental and/or 
> privileged information and is intended for use by the indicated addressee 
> only. If you have received this message in error, please notify the sender 
> immediately, destroy the original message and any attachment and delete this 
> message and any attachment from your system. Unauthorized use, distribution, 
> disclosure, reproduction, or alteration of this e-mail message is forbidden. 
> Raiffeisenbank Austria d.d. neither makes nor accepts legally binding 
> statements via e-mail unless otherwise stated. Considering that internet 
> communication is not secured, Raiffeisenbank Austria d.d. is not responsible 
> for the content of this message, for potential damage occured due to 
> infection of this message with a virus or other malicious program, and for 
> potential technical problems during delivery of this message.

Claus Ibsen
----------------- @davsclaus
Camel in Action 2:

Reply via email to