I have a problem where in my in coming XML messages I have ° symbols these
are marking
degrees on lat and long values. I am using version camel 2.0.0
I have specified my data format as follows
<camel:dataFormats>
<camel:jaxb encoding="uft-8"
id="incidentJaxb"
prettyPrint="true"
contextPath="au.bla.bla.bla.bla.bla.bla.incident" />
</camel:dataFormats>
and call it in my route:
<camel:unmarshal ref="incidentJaxb" />
Thousands of messages process with out failure except the ones with the
invalid ° character they end up in to my dead letter queue
I suppose my question is, is encoding still a problem in camel as per this
thread
from earlier in the year?
Thanks Matt
Magnus Heino wrote:
>
> A xml-message encoded in utf-8 containing åäö routed through this route is
> trashed. åäö is not åäö after this route. If I remove the marshal call,
> the
> problem goes away.
>
> this.from("direct:request").marshal(soapDataFormat).convertBodyTo(
> String.class).to(requestUri);
>
> To be sure that it wasn't my dataformat that trashed it, I wrote this
> processor:
>
> final Processor wrapSoap = new Processor() {
>
> public void process(Exchange exchange) throws Exception {
> ByteArrayOutputStream outputStream = new
> ByteArrayOutputStream();
> soapDataFormat.marshal(exchange, new
> StringSource((String) exchange.getIn().getBody()), outputStream);
> exchange.getOut(true).setBody(outputStream.toString
> ("UTF-8"));
>
> }
> };
>
> and applied this route:
>
> this.from("direct:request").process(this.wrapSoap).convertBodyTo(
> String.class).to(requestUri);
>
> And now things are working...
>
> Looking at org.apache.camel.processor.MarshalProcessor.java that is used
> in
> the marshal()-call, is this really ok to do with utf-8 data?
>
> dataFormat.marshal(exchange, body, buffer);
> byte[] data = buffer.toByteArray();
> out.setBody(data);
>
> --
>
> /Magnus Heino
>
>
--
View this message in context:
http://www.nabble.com/MarshalProcessor-utf-8-bug--tp16037986p25530930.html
Sent from the Camel - Users (activemq) mailing list archive at Nabble.com.