A implementação da classe RotaPedidos:
import org.apache.camel.CamelContext;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.impl.DefaultCamelContext;
public class RotaPedidos {
public static void main(String[] args) throws Exception {
CamelContext context = new DefaultCamelContext();
context.addRoutes(new RouteBuilder() {
public void configure() throws Exception {
from("file:pedidos?delay=5s&noop=true").
filter().xpath("/pedido/itens/item/formato[text()='EBOOK']").
to("file:saida");
}
});
context.start();
Thread.sleep(20000);
context.stop();
}
}
O problema é que a chamada o xpath é:
Object org.apache.camel.builder.ExpressionClause.xpath(String text)
E o filter() é:
ExpressionClause org.apache.camel.model.ProcessorDefinition.filter()