Camel 2.21에서는 인바운드 메시지 헤더 를 통해 macvlan 헤더를 전달할 수 있는 지원이 있으며, Camel 메시지의 Sforce 또는 x-sfdc 로 시작하는 헤더는 요청에서 전달되며 Sforce 로 시작하는 응답 헤더는 outboud 메시지 헤더에 표시됩니다.
예를 들어 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