인바운드 메시지 헤더 를 통해 hieradata 헤더를 전달할 수 있으며, 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);
}
}
// 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);
}
}
Copy to ClipboardCopied!Toggle word wrapToggle overflow
또한 HTTP 응답 상태 코드와 텍스트는 Exchange.HTTP_RESPONSE_CODE 및 Exchange.HTTP_RESPONSE_TEXT.