public static void main(String[] args) throws Exception{
CamelContext context = new DefaultCamelContext();
final XStream xstream = new XStream();
xstream.alias("negociacao", Negociacao.class);
context.addRoutes(new RouteBuilder() {
@Override
public void configure() throws Exception {
// TODO Auto-generated method stub
//String xStream = "";
from("timer://negociacoes?fixedRate=true&delay=1s&period=360s").
to("http4://argentumws.caelum.com.br/negociacoes").
convertBodyTo(String.class).
unmarshal(new XStreamDataFormat(xstream)).
split(body()).
log("${body}").
end();
//setHeader(Exchange.FILE_NAME, constant("negociacoes.xml")).
//to("file:saida");
}
});
context.start();
Thread.sleep(20000);
context.stop();
}