Search in sources :

Example 1 with PassThroughServiceFilter

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;
}
Also used : PassThroughServiceFilter(org.apache.camel.impl.cloud.PassThroughServiceFilter) ServiceFilter(org.apache.camel.cloud.ServiceFilter) HealthyServiceFilter(org.apache.camel.impl.cloud.HealthyServiceFilter) PassThroughServiceFilter(org.apache.camel.impl.cloud.PassThroughServiceFilter) HealthyServiceFilter(org.apache.camel.impl.cloud.HealthyServiceFilter)

Aggregations

ServiceFilter (org.apache.camel.cloud.ServiceFilter)1 HealthyServiceFilter (org.apache.camel.impl.cloud.HealthyServiceFilter)1 PassThroughServiceFilter (org.apache.camel.impl.cloud.PassThroughServiceFilter)1