package crawler.route;

import crawler.processor.Processor0;
import org.apache.camel.Exchange;
import org.apache.camel.builder.RouteBuilder;

/**
 * Created by lingfeng on 2016/7/25.
 */
public class CrawlerRouteBulider extends RouteBuilder {

    @Override
    public void configure() throws Exception {

        from("jetty:http://192.168.131.96:8066/crawlerPull").routeId("crawlerPull")
                .process(new Processor0()).setHeader(Exchange.HTTP_METHOD, constant("POST"))
                .to("http://192.168.131.96:8088/crawler/patientList");

        from("jetty:http://192.168.131.96:8066/crawlerPush").routeId("crawlerPush")
                .process(new Processor0()).setHeader(Exchange.HTTP_METHOD, constant("POST"))
                .to("http://192.168.131.96:8088/crawler/patient");

        from("jetty:http://192.168.131.96:8066/crawlerFlowPull").routeId("crawlerFlowPull")
                .process(new Processor0()).setHeader(Exchange.HTTP_METHOD, constant("POST"))
                .to("http://192.168.131.96:8088/crawler/patientListFlow");

        from("jetty:http://192.168.131.96:8066/crawlerFlowPush").routeId("crawlerFlowPush")
                .process(new Processor0()).setHeader(Exchange.HTTP_METHOD, constant("POST"))
                .to("http://192.168.131.96:8088/crawler/patientFlow");
    }
}
