from(CXF_RS_ENDPOINT_URI)
.process(new Processor() {
public void process(Exchange exchange) throws Exception {
Message inMessage = exchange.getIn();
System.out.println("headers->" + inMessage.getHeaders());
...
这是我的单元测试代码来模拟客户端请求。。。
HttpGet get = new HttpGet("http://localhost:9000/rest/customerservice/customers/126");
get.addHeader("myHeader", "1234");
HttpClient httpclient = new DefaultHttpClient();
HttpResponse response = httpclient.execute(get);
问题是自定义头“myHeader”在我的路由中不可用。还有别的办法吗?
通过查看camelcxf源代码,我可以看到默认的头策略/绑定逻辑只设置预定义的HTTP头。有没有其他头文件不能通过的原因?
谢谢