package com.yihu.hos.camel.qlc.route;

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

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

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