use of org.apache.camel.impl.cloud.PassThroughServiceFilter in project camel by apache.
the class ServiceCallDefinition method retrieveServiceFilter.
// ******************************************
// ServiceFilter
// ******************************************
private ServiceFilter retrieveServiceFilter(CamelContext camelContext, Function<CamelContext, ServiceCallConfigurationDefinition> function) throws Exception {
ServiceFilter answer = null;
ServiceCallConfigurationDefinition config = function.apply(camelContext);
if (config != null) {
if (config.getServiceFilterConfiguration() != null) {
answer = config.getServiceFilterConfiguration().newInstance(camelContext);
} else {
answer = retrieve(ServiceFilter.class, camelContext, config::getServiceFilter, config::getServiceFilterRef);
}
if (answer == null) {
String ref = config.getServiceFilterRef();
if (ObjectHelper.equal("healthy", ref, true)) {
answer = new HealthyServiceFilter();
} else if (ObjectHelper.equal("pass-through", ref, true)) {
answer = new PassThroughServiceFilter();
} else if (ObjectHelper.equal("passthrough", ref, true)) {
answer = new PassThroughServiceFilter();
}
}
}
return answer;
}
Aggregations