@Override protected void resume(final HttpResponseMessage zuulMesg) { if (zuulMesg.getContext().isCancelled()) { return; } invokeNextStage(zuulMesg); }
private void onOriginConnectFailed(Throwable cause) { passport.add(ORIGIN_CONN_ACQUIRE_FAILED); if (! context.isCancelled()) { errorFromOrigin(cause); } }
private void onOriginConnectFailed(Throwable cause) { passport.add(ORIGIN_CONN_ACQUIRE_FAILED); if (! context.isCancelled()) { errorFromOrigin(cause); } }
@Override protected void resume(final HttpResponseMessage zuulMesg) { if (zuulMesg.getContext().isCancelled()) { return; } invokeNextStage(zuulMesg); }
if ((zuulRequest != null) && (! zuulRequest.getContext().isCancelled())) { ctx.fireChannelRead(msg); } else {
private void onOriginConnectSucceeded(PooledConnection conn, int readTimeout) { passport.add(ORIGIN_CONN_ACQUIRE_END); if (context.isCancelled()) { conn.release(); } else { // Set the read timeout (we only do this late because this timeout can be adjusted dynamically by the niws RequestExpiryExecutionListener // that is run as part of onRequestStartWithServer() above. // Add a ReadTimeoutHandler to the channel before we send a request on it. conn.startReadTimeoutHandler(readTimeout); // Also update the RequestAttempt to reflect the readTimeout chosen. currentRequestAttempt.setReadTimeout(readTimeout); // Start sending the request to origin now. writeClientRequestToOrigin(conn); } }
protected final boolean shouldSkipFilter(final I inMesg, final ZuulFilter<I, O> filter) { if (filter.filterType() == ENDPOINT) { //Endpoints may not be skipped return false; } final SessionContext zuulCtx = inMesg.getContext(); if (!filter.shouldFilter(inMesg)) { return true; } if ((zuulCtx.shouldStopFilterProcessing()) && (!filter.overrideStopFilterProcessing())) { return true; } if (zuulCtx.isCancelled()) { return true; } return false; }
@Override public void filter(final HttpRequestMessage zuulReq) { if (zuulReq.getContext().isCancelled()) { zuulReq.disposeBufferedBody(); logger.debug("Request was cancelled, UUID {}", zuulReq.getContext().getUUID()); return; } final String endpointName = getEndPointName(zuulReq.getContext()); try { Preconditions.checkNotNull(zuulReq, "input message"); final ZuulFilter<HttpRequestMessage, HttpResponseMessage> endpoint = getEndpoint(endpointName, zuulReq); logger.debug("Got endpoint {}, UUID {}", endpoint.filterName(), zuulReq.getContext().getUUID()); setEndpoint(zuulReq, endpoint); final HttpResponseMessage zuulResp = filter(endpoint, zuulReq); if ((zuulResp != null)&&(! (endpoint instanceof ProxyEndpoint))) { //EdgeProxyEndpoint calls invokeNextStage internally logger.debug("Endpoint calling invokeNextStage, UUID {}", zuulReq.getContext().getUUID()); invokeNextStage(zuulResp); } } catch (Exception ex) { handleException(zuulReq, endpointName, ex); } }
if ((zuulRequest != null) && (! zuulRequest.getContext().isCancelled())) { ctx.fireChannelRead(msg); } else {
private void onOriginConnectSucceeded(PooledConnection conn, int readTimeout) { passport.add(ORIGIN_CONN_ACQUIRE_END); if (context.isCancelled()) { conn.release(); } else { // Set the read timeout (we only do this late because this timeout can be adjusted dynamically by the niws RequestExpiryExecutionListener // that is run as part of onRequestStartWithServer() above. // Add a ReadTimeoutHandler to the channel before we send a request on it. conn.startReadTimeoutHandler(readTimeout); // Also update the RequestAttempt to reflect the readTimeout chosen. currentRequestAttempt.setReadTimeout(readTimeout); // Start sending the request to origin now. writeClientRequestToOrigin(conn); } }
protected final boolean shouldSkipFilter(final I inMesg, final ZuulFilter<I, O> filter) { if (filter.filterType() == ENDPOINT) { //Endpoints may not be skipped return false; } final SessionContext zuulCtx = inMesg.getContext(); if (!filter.shouldFilter(inMesg)) { return true; } if ((zuulCtx.shouldStopFilterProcessing()) && (!filter.overrideStopFilterProcessing())) { return true; } if (zuulCtx.isCancelled()) { return true; } return false; }
@Override public void filter(final HttpRequestMessage zuulReq, final HttpContent chunk) { if (zuulReq.getContext().isCancelled()) { chunk.release(); return; } String endpointName = "-"; try { ZuulFilter<HttpRequestMessage, HttpResponseMessage> endpoint = Preconditions.checkNotNull( getEndpoint(zuulReq), "endpoint"); endpointName = endpoint.filterName(); final HttpContent newChunk = endpoint.processContentChunk(zuulReq, chunk); if (newChunk != null) { //Endpoints do not directly forward content chunks to next stage in the filter chain. zuulReq.bufferBodyContents(newChunk); //deallocate original chunk if necessary if (newChunk != chunk) { chunk.release(); } if (isFilterAwaitingBody(zuulReq) && zuulReq.hasCompleteBody() && !(endpoint instanceof ProxyEndpoint)) { //whole body has arrived, resume filter chain invokeNextStage(filter(endpoint, zuulReq)); } } } catch (Exception ex) { handleException(zuulReq, endpointName, ex); } }
@Override public void filter(final HttpRequestMessage zuulReq) { if (zuulReq.getContext().isCancelled()) { zuulReq.disposeBufferedBody(); logger.debug("Request was cancelled, UUID {}", zuulReq.getContext().getUUID()); return; } final String endpointName = getEndPointName(zuulReq.getContext()); try { Preconditions.checkNotNull(zuulReq, "input message"); final ZuulFilter<HttpRequestMessage, HttpResponseMessage> endpoint = getEndpoint(endpointName, zuulReq); logger.debug("Got endpoint {}, UUID {}", endpoint.filterName(), zuulReq.getContext().getUUID()); setEndpoint(zuulReq, endpoint); final HttpResponseMessage zuulResp = filter(endpoint, zuulReq); if ((zuulResp != null)&&(! (endpoint instanceof ProxyEndpoint))) { //EdgeProxyEndpoint calls invokeNextStage internally logger.debug("Endpoint calling invokeNextStage, UUID {}", zuulReq.getContext().getUUID()); invokeNextStage(zuulResp); } } catch (Exception ex) { handleException(zuulReq, endpointName, ex); } }
@Override public void filter(final HttpRequestMessage zuulReq, final HttpContent chunk) { if (zuulReq.getContext().isCancelled()) { chunk.release(); return; } String endpointName = "-"; try { ZuulFilter<HttpRequestMessage, HttpResponseMessage> endpoint = Preconditions.checkNotNull( getEndpoint(zuulReq), "endpoint"); endpointName = endpoint.filterName(); final HttpContent newChunk = endpoint.processContentChunk(zuulReq, chunk); if (newChunk != null) { //Endpoints do not directly forward content chunks to next stage in the filter chain. zuulReq.bufferBodyContents(newChunk); //deallocate original chunk if necessary if (newChunk != chunk) { chunk.release(); } if (isFilterAwaitingBody(zuulReq) && zuulReq.hasCompleteBody() && !(endpoint instanceof ProxyEndpoint)) { //whole body has arrived, resume filter chain invokeNextStage(filter(endpoint, zuulReq)); } } } catch (Exception ex) { handleException(zuulReq, endpointName, ex); } }
private void onOriginConnectFailed(Throwable cause) { passport.add(ORIGIN_CONN_ACQUIRE_FAILED); if (! context.isCancelled()) { errorFromOrigin(cause); } }
@Override protected void resume(final HttpResponseMessage zuulMesg) { if (zuulMesg.getContext().isCancelled()) { return; } invokeNextStage(zuulMesg); }
private void onOriginConnectSucceeded(PooledConnection conn, int readTimeout) { passport.add(ORIGIN_CONN_ACQUIRE_END); if (context.isCancelled()) { conn.release(); } else { // Set the read timeout (we only do this late because this timeout can be adjusted dynamically by the niws RequestExpiryExecutionListener // that is run as part of onRequestStartWithServer() above. // Add a ReadTimeoutHandler to the channel before we send a request on it. conn.startReadTimeoutHandler(readTimeout); // Also update the RequestAttempt to reflect the readTimeout chosen. currentRequestAttempt.setReadTimeout(readTimeout); // Start sending the request to origin now. writeClientRequestToOrigin(conn); } }
protected final boolean shouldSkipFilter(final I inMesg, final ZuulFilter<I, O> filter) { if (filter.filterType() == ENDPOINT) { //Endpoints may not be skipped return false; } final SessionContext zuulCtx = inMesg.getContext(); if (!filter.shouldFilter(inMesg)) { return true; } if ((zuulCtx.shouldStopFilterProcessing()) && (!filter.overrideStopFilterProcessing())) { return true; } if (zuulCtx.isCancelled()) { return true; } return false; }
@Override public void filter(final HttpRequestMessage zuulReq) { if (zuulReq.getContext().isCancelled()) { zuulReq.disposeBufferedBody(); logger.debug("Request was cancelled, UUID {}", zuulReq.getContext().getUUID()); return; } final String endpointName = getEndPointName(zuulReq.getContext()); try { Preconditions.checkNotNull(zuulReq, "input message"); final ZuulFilter<HttpRequestMessage, HttpResponseMessage> endpoint = getEndpoint(endpointName, zuulReq); logger.debug("Got endpoint {}, UUID {}", endpoint.filterName(), zuulReq.getContext().getUUID()); setEndpoint(zuulReq, endpoint); final HttpResponseMessage zuulResp = filter(endpoint, zuulReq); if ((zuulResp != null)&&(! (endpoint instanceof ProxyEndpoint))) { //EdgeProxyEndpoint calls invokeNextStage internally logger.debug("Endpoint calling invokeNextStage, UUID {}", zuulReq.getContext().getUUID()); invokeNextStage(zuulResp); } } catch (Exception ex) { handleException(zuulReq, endpointName, ex); } }
@Override public void filter(final HttpRequestMessage zuulReq, final HttpContent chunk) { if (zuulReq.getContext().isCancelled()) { chunk.release(); return; } String endpointName = "-"; try { ZuulFilter<HttpRequestMessage, HttpResponseMessage> endpoint = Preconditions.checkNotNull( getEndpoint(zuulReq), "endpoint"); endpointName = endpoint.filterName(); final HttpContent newChunk = endpoint.processContentChunk(zuulReq, chunk); if (newChunk != null) { //Endpoints do not directly forward content chunks to next stage in the filter chain. zuulReq.bufferBodyContents(newChunk); //deallocate original chunk if necessary if (newChunk != chunk) { chunk.release(); } if (isFilterAwaitingBody(zuulReq) && zuulReq.hasCompleteBody() && !(endpoint instanceof ProxyEndpoint)) { //whole body has arrived, resume filter chain invokeNextStage(filter(endpoint, zuulReq)); } } } catch (Exception ex) { handleException(zuulReq, endpointName, ex); } }