Thanks for the suggestion.

I have found the conceptual problem on my side; the XStream / Jackson
marshalling both created a Byte array as the body of the message based on
the Object, not a string formatted as "{[name]:[value]}". I thus expected to
receive something like 

"{value:123,name:"Foo",...}" but received {123,22,65,35,67,...}

But indeed its the same, the Byte array just had to be converted to a String
and set in the body before streaming through Cometd.

I now have a bean processor;

public class Bytearray2StringFormatter {
  public synchronized void process(Exchange exchange) {
    exchange.getIn().setBody(new String((byte[])
exchange.getIn().getBody()));
  }
}

And the route



  
    
  
  
    
    
     
  


Works smoothly. Ideas to improvements are however always welcome, i.e. is
there a smarter way of doing the formatting?


--
View this message in context: 
http://camel.465427.n5.nabble.com/Cometd-component-tp4299174p4300394.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to