package com.sagacloud.route.processors; import com.alibaba.fastjson.JSONObject; import com.sagacloud.cache.ProPasCache; import com.sagacloud.route.InitEnvRoute; import com.sagacloud.utils.Const; import org.apache.camel.Exchange; import org.apache.camel.Processor; /** * Created by Xiaoyu on 2018/7/12 */ public class GetPropByPjProcessor implements Processor { @Override public void process(Exchange exchange) throws Exception { String jsonStr = exchange.getIn().getBody(String.class); JSONObject json = JSONObject.parseObject(jsonStr); String projectId = json.getString(Const.HEADER_PROJECT); String secret = ProPasCache.getPjSecret(projectId); exchange.getIn().setBody("{\"venderInfo\":true,\"criteria\":{\"family\":[]}}"); exchange.getIn().setHeader(Exchange.HTTP_CHARACTER_ENCODING, "UTF-8"); // exchange.getIn().setBody("{\"criteria\":{\"family\":[]}}"); exchange.getIn().setHeader(Exchange.HTTP_URI, Const.dataPlatform+"/property/relation_query?method=POST"); exchange.getIn().setHeader(Exchange.HTTP_QUERY,Const.HEADER_PROJECT + "=" + projectId + "&"+ Const.HEADER_SECRET+ "="+ secret); System.out.println("进入C"); } }