288.3. Salesforce 헤더에 전달 및 Salesforce 응답 헤더 가져오기

Camel 2.21에서는 인바운드 메시지 헤더를 통해 Salesforce 헤더를 전달할 수 있으며, Camel 메시지에서 Sforce 또는 x-sfdc 로 시작하는 헤더 이름이 요청에 전달되고 Sforce 로 시작하는 응답 헤더가 아웃보이드 메시지 헤더에 표시됩니다.

예를 들어 API 제한을 가져오려면 다음을 지정할 수 있습니다.

// in your Camel route set the header before Salesforce endpoint
//...
  .setHeader("Sforce-Limit-Info", constant("api-usage"))
  .to("salesforce:getGlobalObjects")
  .to(myProcessor);

// myProcessor will receive `Sforce-Limit-Info` header on the outbound
// message
class MyProcessor implements Processor {
    public void process(Exchange exchange) throws Exception {
        Message in = exchange.getIn();
        String apiLimits = in.getHeader("Sforce-Limit-Info", String.class);
   }
}