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

import org.apache.camel.Exchange;
import org.apache.camel.Message;
import org.apache.camel.Processor;
import org.apache.camel.http.common.HttpMessage;

import java.util.Map;

/**
 * Created by Zdm on 2016/7/13.
 */
public class Processor1 implements Processor {
    public void process(Exchange exchange) throws Exception {
        Message outMessage = exchange.getOut();
        HttpMessage inMessage = (HttpMessage) exchange.getIn();
        outMessage.setHeader(Exchange.HTTP_QUERY, inMessage.getRequest().getQueryString());
        Map paramMap = inMessage.getRequest().getParameterMap();
        for (Object key : paramMap.keySet()) {
            exchange.setProperty(key.toString(), paramMap.get(key));
        }
    }

}
