-
1. Re: Camel - WARNING
davsclaus Apr 10, 2009 4:05 AM (in response to fouquet.f)When you send data back to the JBI endpoint with
to("jbi:service:http://dev.c.com/dam/PivotReceptionJMSProvide")
You should make sure the data is XML based. So for instance the process(processResult) should set the body in the exchange as XML based.
-
2. Re: Camel - WARNING
fouquet.f Apr 10, 2009 4:17 AM (in response to davsclaus)Hi
Thanks for your help, I'm very happy to found reply to my problem so quickly on this forum.
So I'm agree to you, the message body must be in XML format, but I think that I have made that correctly. I send who my process methode to check . By the way after 30 secondes of warning the XML bases messages build by the process methode are send and receve on the next JMS JBI endpoint so the body is correctly.
Hier is my process methode , strangly it work very well when camel is initiate by internal timer ,
and there is warning only when camel is initiate by an http binding component.
In the two case the input MEP is in-only.
Any other idea ?
Thanks by advance
private Processor processResult = new Processor() {
private Element mapping(HashMap res,String newelem,String oldelem){
Element newelement = new Element(newelem);
newelement.setText(res.get("NUMERO").toString());
return newelement;
}
public void process(Exchange exchange) throws Exception {
Message in = exchange.getIn();
HashMap<String, Object> res = in.getBody(HashMap.class);
Element racine = new Element("naf");
org.jdom.Document document = new org.jdom.Document(racine);
racine.addContent(mapping(res,"ti","NUMERO"));
racine.addContent(mapping(res,"lo","LONGITUDE"));
racine.addContent(mapping(res,"la","LATITUDE"));
racine.addContent(mapping(res,"hour","HOUR"));
racine.addContent(mapping(res,"opsat","CODE"));
XMLOutputter serializer = new XMLOutputter();
String msg = serializer.outputString(document);
exchange.getOut(true).setBody(msg, String.class);
}
};
-
3. Re: Camel - WARNING
davsclaus Apr 14, 2009 2:00 AM (in response to fouquet.f)Hi
I am a bit puzzled where the java.util.List comes into the picture? You processor set the body as a plain String that is XML based.
Can you try setting the body without the type convertions
exchange.getOut(true).setBody(msg);
Also you can enable the tracer in Camel that dumps the message structure to help us see where the java.util.List comes into play
See about tracer here:
http://camel.apache.org/tracer.html
Basically adding this code to the route builder:
getContext().addInterceptStrategy(new Tracer());