package qlc.route;

import org.apache.camel.Exchange;
import org.apache.camel.builder.RouteBuilder;
import qlc.processor.Processor1;
import qlc.processor.Processor2;

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

    @Override
    public void configure() throws Exception {
        from("jetty:http4://192.168.131.101:8066/qlc").log("servers: 4").routeId("qlc")
                .process(new Processor1()).setHeader(Exchange.HTTP_METHOD, constant("POST"))
                .to("http4://192.168.131.101:8088/api/v1.0/qlc/queryUserInfo").log("servers: 4")
                .process(new Processor2()).setHeader(Exchange.HTTP_METHOD, constant("POST"))
                .to("http4://192.168.131.101:8088/api/v1.0/qlc/patientInformation").log("servers: 4")
                .process(new Processor2()).setHeader(Exchange.HTTP_METHOD, constant("POST"))
                .to("http4://192.168.131.101:8088/crawler/patient").log("servers: 4").to("stream:out"); // 2. 为路由配置组件或终端节点.
    }
}
