Search in sources :

Example 1 with MissingEndpointHandlingFilter

use of com.netflix.zuul.filters.endpoint.MissingEndpointHandlingFilter in project zuul by Netflix.

the class ZuulEndPointRunner method getEndpoint.

protected ZuulFilter<HttpRequestMessage, HttpResponseMessage> getEndpoint(final String endpointName, final HttpRequestMessage zuulRequest) {
    final SessionContext zuulCtx = zuulRequest.getContext();
    if (zuulCtx.getStaticResponse() != null) {
        return STATIC_RESPONSE_ENDPOINT;
    }
    if (endpointName == null) {
        return new MissingEndpointHandlingFilter("NO_ENDPOINT_NAME");
    }
    if (PROXY_ENDPOINT_FILTER_NAME.equals(endpointName)) {
        return newProxyEndpoint(zuulRequest);
    }
    final Endpoint<HttpRequestMessage, HttpResponseMessage> filter = getEndpointFilter(endpointName);
    if (filter == null) {
        return new MissingEndpointHandlingFilter(endpointName);
    }
    return filter;
}
Also used : HttpResponseMessage(com.netflix.zuul.message.http.HttpResponseMessage) MissingEndpointHandlingFilter(com.netflix.zuul.filters.endpoint.MissingEndpointHandlingFilter) HttpRequestMessage(com.netflix.zuul.message.http.HttpRequestMessage) SessionContext(com.netflix.zuul.context.SessionContext)

Aggregations

SessionContext (com.netflix.zuul.context.SessionContext)1 MissingEndpointHandlingFilter (com.netflix.zuul.filters.endpoint.MissingEndpointHandlingFilter)1 HttpRequestMessage (com.netflix.zuul.message.http.HttpRequestMessage)1 HttpResponseMessage (com.netflix.zuul.message.http.HttpResponseMessage)1