You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2019/09/17 14:07:57 UTC

[camel] branch master updated: CAMEL-13918: camel3 - camel-http - Remove deprecate url rewrite

This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/master by this push:
     new 192985d  CAMEL-13918: camel3 - camel-http - Remove deprecate url rewrite
192985d is described below

commit 192985d15c337b51dae09bd2cd21e58141d128d7
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Tue Sep 17 16:06:09 2019 +0200

    CAMEL-13918: camel3 - camel-http - Remove deprecate url rewrite
---
 .../camel/http/common/HttpCommonEndpoint.java      | 19 -----
 .../org/apache/camel/http/common/HttpHelper.java   | 84 ----------------------
 .../camel/http/common/HttpServletUrlRewrite.java   | 42 -----------
 .../org/apache/camel/http/common/UrlRewrite.java   | 41 -----------
 .../UrlRewriteHttpServletRequestAdapter.java       | 50 -------------
 .../camel-http/src/main/docs/http-component.adoc   |  3 +-
 .../apache/camel/component/http/HttpComponent.java |  9 ---
 .../apache/camel/component/http/HttpProducer.java  |  8 ---
 .../camel/component/http/GoogleUrlRewrite.java     | 35 ---------
 .../camel/component/http/UrlRewriteTest.java       | 58 ---------------
 .../camel/component/jetty/JettyHttpComponent.java  |  8 ---
 .../camel/component/jetty/HttpUrlRewriteTest.java  | 59 ---------------
 .../apache/camel/component/jetty/MyUrlRewrite.java | 31 --------
 .../modules/ROOT/pages/http-component.adoc         |  3 +-
 14 files changed, 2 insertions(+), 448 deletions(-)

diff --git a/components/camel-http-common/src/main/java/org/apache/camel/http/common/HttpCommonEndpoint.java b/components/camel-http-common/src/main/java/org/apache/camel/http/common/HttpCommonEndpoint.java
index 7dae568..547ec36 100644
--- a/components/camel-http-common/src/main/java/org/apache/camel/http/common/HttpCommonEndpoint.java
+++ b/components/camel-http-common/src/main/java/org/apache/camel/http/common/HttpCommonEndpoint.java
@@ -122,11 +122,6 @@ public abstract class HttpCommonEndpoint extends DefaultEndpoint implements Head
             description = "The status codes which are considered a success response. The values are inclusive. Multiple ranges can be"
                     + " defined, separated by comma, e.g. 200-204,209,301-304. Each range must be a single number or from-to with the dash included.")
     private String okStatusCodeRange = "200-299";
-    @UriParam(label = "producer,advanced",
-            description = "Refers to a custom org.apache.camel.component.http.UrlRewrite which allows you to rewrite urls when you bridge/proxy endpoints."
-                    + " See more details at http://camel.apache.org/urlrewrite.html")
-    @Deprecated
-    private UrlRewrite urlRewrite;
     @UriParam(label = "consumer", defaultValue = "false",
             description = "Configure the consumer to work in async mode")
     private boolean async;
@@ -441,20 +436,6 @@ public abstract class HttpCommonEndpoint extends DefaultEndpoint implements Head
         this.httpMethodRestrict = httpMethodRestrict;
     }
 
-    @Deprecated
-    public UrlRewrite getUrlRewrite() {
-        return urlRewrite;
-    }
-
-    /**
-     * Refers to a custom org.apache.camel.component.http.UrlRewrite which allows you to rewrite urls when you bridge/proxy endpoints.
-     * See more details at http://camel.apache.org/urlrewrite.html
-     */
-    @Deprecated
-    public void setUrlRewrite(UrlRewrite urlRewrite) {
-        this.urlRewrite = urlRewrite;
-    }
-
     public Integer getResponseBufferSize() {
         return responseBufferSize;
     }
diff --git a/components/camel-http-common/src/main/java/org/apache/camel/http/common/HttpHelper.java b/components/camel-http-common/src/main/java/org/apache/camel/http/common/HttpHelper.java
index f84e85c..c688efd 100644
--- a/components/camel-http-common/src/main/java/org/apache/camel/http/common/HttpHelper.java
+++ b/components/camel-http-common/src/main/java/org/apache/camel/http/common/HttpHelper.java
@@ -393,90 +393,6 @@ public final class HttpHelper {
     }
 
     /**
-     * Processes any custom {@link org.apache.camel.http.common.UrlRewrite}.
-     *
-     * @param exchange    the exchange
-     * @param url         the url
-     * @param endpoint    the http endpoint
-     * @param producer    the producer
-     * @return            the rewritten url, or <tt>null</tt> to use original url
-     * @throws Exception is thrown if any error during rewriting url
-     */
-    public static String urlRewrite(Exchange exchange, String url, HttpCommonEndpoint endpoint, Producer producer) throws Exception {
-        String answer = null;
-
-        String relativeUrl;
-        if (endpoint.getUrlRewrite() != null) {
-            // we should use the relative path if possible
-            String baseUrl;
-            relativeUrl = endpoint.getHttpUri().toASCIIString();
-            // strip query parameters from relative url
-            if (relativeUrl.contains("?")) {
-                relativeUrl = StringHelper.before(relativeUrl, "?");
-            }
-            if (url.startsWith(relativeUrl)) {
-                baseUrl = url.substring(0, relativeUrl.length());
-                relativeUrl = url.substring(relativeUrl.length());
-            } else {
-                baseUrl = null;
-                relativeUrl = url;
-            }
-            // mark it as null if its empty
-            if (ObjectHelper.isEmpty(relativeUrl)) {
-                relativeUrl = null;
-            }
-
-            String newUrl;
-            if (endpoint.getUrlRewrite() instanceof HttpServletUrlRewrite) {
-                // its servlet based, so we need the servlet request
-                HttpServletRequest request = exchange.getIn().getBody(HttpServletRequest.class);
-                if (request == null) {
-                    HttpMessage msg = exchange.getIn(HttpMessage.class);
-                    if (msg != null) {
-                        request = msg.getRequest();
-                    }
-                }
-                if (request == null) {
-                    throw new IllegalArgumentException("UrlRewrite " + endpoint.getUrlRewrite() + " requires the message body to be a"
-                            + "HttpServletRequest instance, but was: " + ObjectHelper.className(exchange.getIn().getBody()));
-                }
-                // we need to adapt the context-path to be the path from the endpoint, if it came from a http based endpoint
-                // as eg camel-jetty have hardcoded context-path as / for all its servlets/endpoints
-                // we have the actual context-path stored as a header with the key CamelServletContextPath
-                String contextPath = exchange.getIn().getHeader("CamelServletContextPath", String.class);
-                request = new UrlRewriteHttpServletRequestAdapter(request, contextPath);
-                newUrl = ((HttpServletUrlRewrite) endpoint.getUrlRewrite()).rewrite(url, relativeUrl, producer, request);
-            } else {
-                newUrl = endpoint.getUrlRewrite().rewrite(url, relativeUrl, producer);
-            }
-
-            if (ObjectHelper.isNotEmpty(newUrl) && !newUrl.equals(url)) {
-                // we got a new url back, that can either be a new absolute url
-                // or a new relative url
-                if (newUrl.startsWith("http:") || newUrl.startsWith("https:")) {
-                    answer = newUrl;
-                } else if (baseUrl != null) {
-                    // avoid double // when adding the urls
-                    if (baseUrl.endsWith("/") && newUrl.startsWith("/")) {
-                        answer = baseUrl + newUrl.substring(1);
-                    } else {
-                        answer = baseUrl + newUrl;
-                    }
-                } else {
-                    // use the new url as is
-                    answer = newUrl;
-                }
-                if (LOG.isDebugEnabled()) {
-                    LOG.debug("Using url rewrite to rewrite from url {} to {} -> {}",
-                            new Object[]{relativeUrl != null ? relativeUrl : url, newUrl, answer});
-                }
-            }
-        }
-
-        return answer;
-    }
-
-    /**
      * Creates the HttpMethod to use to call the remote server, often either its GET or POST.
      *
      * @param exchange  the exchange
diff --git a/components/camel-http-common/src/main/java/org/apache/camel/http/common/HttpServletUrlRewrite.java b/components/camel-http-common/src/main/java/org/apache/camel/http/common/HttpServletUrlRewrite.java
deleted file mode 100644
index 38133b1..0000000
--- a/components/camel-http-common/src/main/java/org/apache/camel/http/common/HttpServletUrlRewrite.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.http.common;
-
-import javax.servlet.http.HttpServletRequest;
-
-import org.apache.camel.Producer;
-
-/**
- * Extended {@link UrlRewrite} which leverages {@link HttpServletRequest}
- * during the rewrite process.
- */
-public interface HttpServletUrlRewrite extends UrlRewrite {
-
-    /**
-     * Rewrite the url.
-     *
-     * @param url  the absolute url (eg with scheme://host:port/path?query)
-     * @param relativeUrl optional relative url, if bridging endpoints, which then would be without the base path from the
-     *                    endpoint from the given producer.
-     * @param producer the producer to use the rewritten url
-     * @param request  the http servlet request
-     * @return the rewritten url, or <tt>null</tt> to use the original url
-     * @throws Exception is thrown if error rewriting the url
-     */
-    String rewrite(String url, String relativeUrl, Producer producer, HttpServletRequest request) throws Exception;
-
-}
diff --git a/components/camel-http-common/src/main/java/org/apache/camel/http/common/UrlRewrite.java b/components/camel-http-common/src/main/java/org/apache/camel/http/common/UrlRewrite.java
deleted file mode 100644
index 53d468c..0000000
--- a/components/camel-http-common/src/main/java/org/apache/camel/http/common/UrlRewrite.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.http.common;
-
-import org.apache.camel.Producer;
-
-/**
- * Allows to plugin custom strategy for rewriting url.
- * <p/>
- * This allows for example to proxy http services and plugin a url rewrite
- * strategy such as the <a href="http://camel.apache.org/urlrewrite">url-rewrite</a> component.
- */
-public interface UrlRewrite {
-
-    /**
-     * Rewrite the url.
-     *
-     * @param url  the absolute url (eg with scheme://host:port/path?query)
-     * @param relativeUrl optional relative url, if bridging endpoints, which then would be without the base path from the
-     *                    endpoint from the given producer.
-     * @param producer the producer to use the rewritten url
-     * @return the rewritten url, or <tt>null</tt> to use the original url
-     * @throws Exception is thrown if error rewriting the url
-     */
-    String rewrite(String url, String relativeUrl, Producer producer) throws Exception;
-
-}
diff --git a/components/camel-http-common/src/main/java/org/apache/camel/http/common/UrlRewriteHttpServletRequestAdapter.java b/components/camel-http-common/src/main/java/org/apache/camel/http/common/UrlRewriteHttpServletRequestAdapter.java
deleted file mode 100644
index 82c0ec7..0000000
--- a/components/camel-http-common/src/main/java/org/apache/camel/http/common/UrlRewriteHttpServletRequestAdapter.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.http.common;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletRequestWrapper;
-
-/**
- * Special adapter when {@link org.apache.camel.http.common.HttpServletUrlRewrite} is in use,
- * and the route started from came-jetty/camel-serlvet.
- * <p/>
- * This adapter ensures that we can control the context-path returned from the
- * {@link javax.servlet.http.HttpServletRequest#getContextPath()} method.
- * This allows us to ensure the context-path is based on the endpoint path, as the
- * camel-jetty/camel-servlet server implementation uses the root ("/") context-path
- * for all the servlets/endpoints.
- */
-public final class UrlRewriteHttpServletRequestAdapter extends HttpServletRequestWrapper {
-
-    private final String contextPath;
-
-    /**
-     * Creates this adapter
-     * @param delegate    the real http servlet request to delegate.
-     * @param contextPath use to override and return this context-path
-     */
-    public UrlRewriteHttpServletRequestAdapter(HttpServletRequest delegate, String contextPath) {
-        super(delegate);
-        this.contextPath = contextPath;
-    }
-
-    @Override
-    public String getContextPath() {
-        return contextPath != null ? contextPath : super.getContextPath();
-    }
-}
diff --git a/components/camel-http/src/main/docs/http-component.adoc b/components/camel-http/src/main/docs/http-component.adoc
index 166b9ca..4018993 100644
--- a/components/camel-http/src/main/docs/http-component.adoc
+++ b/components/camel-http/src/main/docs/http-component.adoc
@@ -101,7 +101,7 @@ with the following path and query parameters:
 |===
 
 
-=== Query Parameters (51 parameters):
+=== Query Parameters (50 parameters):
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
@@ -126,7 +126,6 @@ with the following path and query parameters:
 | *transferException* (producer) | If enabled and an Exchange failed processing on the consumer side, and if the caused Exception was send back serialized in the response as a application/x-java-serialized-object content type. On the producer side the exception will be deserialized and thrown as is, instead of the HttpOperationFailedException. The caused exception is required to be serialized. This is by default turned off. If you enable this then be aware that Java will deserialize the  [...]
 | *cookieHandler* (producer) | Configure a cookie handler to maintain a HTTP session |  | CookieHandler
 | *okStatusCodeRange* (producer) | The status codes which are considered a success response. The values are inclusive. Multiple ranges can be defined, separated by comma, e.g. 200-204,209,301-304. Each range must be a single number or from-to with the dash included. | 200-299 | String
-| *urlRewrite* (producer) | *Deprecated* Refers to a custom org.apache.camel.component.http.UrlRewrite which allows you to rewrite urls when you bridge/proxy endpoints. See more details at \http://camel.apache.org/urlrewrite.html |  | UrlRewrite
 | *basicPropertyBinding* (advanced) | Whether the endpoint should use basic property binding (Camel 2.x) or the newer property binding with additional capabilities | false | boolean
 | *clientBuilder* (advanced) | Provide access to the http client request parameters used on new RequestConfig instances used by producers or consumers of this endpoint. |  | HttpClientBuilder
 | *clientConnectionManager* (advanced) | To use a custom HttpClientConnectionManager to manage connections |  | HttpClientConnectionManager
diff --git a/components/camel-http/src/main/java/org/apache/camel/component/http/HttpComponent.java b/components/camel-http/src/main/java/org/apache/camel/component/http/HttpComponent.java
index 84e5fa5..78f3a20 100644
--- a/components/camel-http/src/main/java/org/apache/camel/component/http/HttpComponent.java
+++ b/components/camel-http/src/main/java/org/apache/camel/component/http/HttpComponent.java
@@ -36,7 +36,6 @@ import org.apache.camel.http.common.HttpBinding;
 import org.apache.camel.http.common.HttpCommonComponent;
 import org.apache.camel.http.common.HttpHelper;
 import org.apache.camel.http.common.HttpRestHeaderFilterStrategy;
-import org.apache.camel.http.common.UrlRewrite;
 import org.apache.camel.spi.BeanIntrospection;
 import org.apache.camel.spi.HeaderFilterStrategy;
 import org.apache.camel.spi.Metadata;
@@ -234,7 +233,6 @@ public class HttpComponent extends HttpCommonComponent implements RestProducerFa
         String httpMethodRestrict = getAndRemoveParameter(parameters, "httpMethodRestrict", String.class);
 
         HeaderFilterStrategy headerFilterStrategy = resolveAndRemoveReferenceParameter(parameters, "headerFilterStrategy", HeaderFilterStrategy.class);
-        UrlRewrite urlRewrite = resolveAndRemoveReferenceParameter(parameters, "urlRewrite", UrlRewrite.class);
 
         boolean secure = HttpHelper.isSecureConnection(uri) || sslContextParameters != null;
 
@@ -285,13 +283,6 @@ public class HttpComponent extends HttpCommonComponent implements RestProducerFa
             setProperties(endpoint, properties);
         }
 
-        if (urlRewrite != null) {
-            // let CamelContext deal with the lifecycle of the url rewrite
-            // this ensures its being shutdown when Camel shutdown etc.
-            getCamelContext().addService(urlRewrite);
-            endpoint.setUrlRewrite(urlRewrite);
-        }
-
         // configure the endpoint
         setProperties(endpoint, parameters);
 
diff --git a/components/camel-http/src/main/java/org/apache/camel/component/http/HttpProducer.java b/components/camel-http/src/main/java/org/apache/camel/component/http/HttpProducer.java
index 54fdd39..94c12cd 100644
--- a/components/camel-http/src/main/java/org/apache/camel/component/http/HttpProducer.java
+++ b/components/camel-http/src/main/java/org/apache/camel/component/http/HttpProducer.java
@@ -439,14 +439,6 @@ public class HttpProducer extends DefaultProducer {
         // get the url from the uri
         url = uri.toASCIIString();
 
-        // execute any custom url rewrite
-        String rewriteUrl = HttpHelper.urlRewrite(exchange, url, getEndpoint(), this);
-        if (rewriteUrl != null) {
-            // update url and query string from the rewritten url
-            url = rewriteUrl;
-            uri = new URI(url);
-        }
-
         // create http holder objects for the request
         HttpEntity requestEntity = createRequestEntity(exchange);
         HttpMethods methodToUse = HttpMethodHelper.createMethod(exchange, getEndpoint(), requestEntity != null);
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/GoogleUrlRewrite.java b/components/camel-http/src/test/java/org/apache/camel/component/http/GoogleUrlRewrite.java
deleted file mode 100644
index e353709..0000000
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/GoogleUrlRewrite.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.component.http;
-
-import org.apache.camel.Producer;
-import org.apache.camel.http.common.UrlRewrite;
-
-// START SNIPPET: e1
-/**
- * A very simple url rewrite that replaces yahoo with google in the url.
- * <p/>
- * This is only used for testing purposes.
- */
-public class GoogleUrlRewrite implements UrlRewrite {
-
-    @Override
-    public String rewrite(String url, String relativeUrl, Producer producer) {
-        return url.replaceAll("yahoo", "google");
-    }
-}
-// END SNIPPET: e1
diff --git a/components/camel-http/src/test/java/org/apache/camel/component/http/UrlRewriteTest.java b/components/camel-http/src/test/java/org/apache/camel/component/http/UrlRewriteTest.java
deleted file mode 100644
index 338465b..0000000
--- a/components/camel-http/src/test/java/org/apache/camel/component/http/UrlRewriteTest.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.component.http;
-
-import org.apache.camel.BindToRegistry;
-import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.test.junit4.CamelTestSupport;
-import org.junit.Ignore;
-import org.junit.Test;
-
-/**
- *
- */
-public class UrlRewriteTest extends CamelTestSupport {
-
-    @BindToRegistry("fooRewrite")
-    private GoogleUrlRewrite googleUrlRewrite = new GoogleUrlRewrite();
-
-    @Test
-    @Ignore
-    public void testUrlRewrite() throws Exception {
-        MockEndpoint mock = getMockEndpoint("mock:result");
-        mock.expectedMessageCount(1);
-
-        template.sendBody("direct:start", null);
-
-        assertMockEndpointsSatisfied();
-    }
-
-    @Override
-    protected RouteBuilder createRouteBuilder() throws Exception {
-        return new RouteBuilder() {
-            public void configure() {
-                from("direct:start")
-                        .to("http://www.yahoo.com?q=camel&urlRewrite=#fooRewrite")
-                        .convertBodyTo(String.class)
-                        .to("log:result", "mock:result");
-            }
-        };
-    }
-
-
-}
diff --git a/components/camel-jetty-common/src/main/java/org/apache/camel/component/jetty/JettyHttpComponent.java b/components/camel-jetty-common/src/main/java/org/apache/camel/component/jetty/JettyHttpComponent.java
index 2c23848..bf892aa 100644
--- a/components/camel-jetty-common/src/main/java/org/apache/camel/component/jetty/JettyHttpComponent.java
+++ b/components/camel-jetty-common/src/main/java/org/apache/camel/component/jetty/JettyHttpComponent.java
@@ -49,7 +49,6 @@ import org.apache.camel.http.common.HttpCommonEndpoint;
 import org.apache.camel.http.common.HttpConfiguration;
 import org.apache.camel.http.common.HttpConsumer;
 import org.apache.camel.http.common.HttpRestServletResolveConsumerStrategy;
-import org.apache.camel.http.common.UrlRewrite;
 import org.apache.camel.spi.HeaderFilterStrategy;
 import org.apache.camel.spi.ManagementAgent;
 import org.apache.camel.spi.ManagementStrategy;
@@ -179,7 +178,6 @@ public abstract class JettyHttpComponent extends HttpCommonComponent implements
         List<Filter> filters = resolveAndRemoveReferenceListParameter(parameters, "filters", Filter.class);
         Boolean enableCors = getAndRemoveParameter(parameters, "enableCORS", Boolean.class, false);
         HeaderFilterStrategy headerFilterStrategy = resolveAndRemoveReferenceParameter(parameters, "headerFilterStrategy", HeaderFilterStrategy.class);
-        UrlRewrite urlRewrite = resolveAndRemoveReferenceParameter(parameters, "urlRewrite", UrlRewrite.class);
         SSLContextParameters sslContextParameters = resolveAndRemoveReferenceParameter(parameters, "sslContextParameters", SSLContextParameters.class);
         SSLContextParameters ssl = sslContextParameters != null ? sslContextParameters : this.sslContextParameters;
         ssl = ssl != null ? ssl : retrieveGlobalSslContextParameters();
@@ -218,12 +216,6 @@ public abstract class JettyHttpComponent extends HttpCommonComponent implements
             endpoint.setProxyHost(proxyHost);
             endpoint.setProxyPort(proxyPort);
         }
-        if (urlRewrite != null) {
-            // let CamelContext deal with the lifecycle of the url rewrite
-            // this ensures its being shutdown when Camel shutdown etc.
-            getCamelContext().addService(urlRewrite);
-            endpoint.setUrlRewrite(urlRewrite);
-        }
         if (!filterInitParameters.isEmpty()) {
             endpoint.setFilterInitParameters(filterInitParameters);
         }
diff --git a/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/HttpUrlRewriteTest.java b/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/HttpUrlRewriteTest.java
deleted file mode 100644
index 6727b45..0000000
--- a/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/HttpUrlRewriteTest.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.component.jetty;
-
-import org.apache.camel.BindToRegistry;
-import org.apache.camel.Exchange;
-import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.component.mock.MockEndpoint;
-import org.junit.Test;
-
-public class HttpUrlRewriteTest extends BaseJettyTest {
-
-    private int port1;
-    private int port2;
-
-    @BindToRegistry("myRewrite")
-    private MyUrlRewrite urlRew = new MyUrlRewrite();
-
-    @Test
-    public void testUrlRewrite() throws Exception {
-        MockEndpoint mock = getMockEndpoint("mock:result");
-        mock.expectedMessageCount(1);
-
-        String response = template.requestBodyAndHeader("http://localhost:" + port1 + "/foo?phrase=Bye", "Camel", Exchange.HTTP_METHOD, "POST", String.class);
-        assertEquals("Get a wrong response", "Bye Camel", response);
-
-        assertMockEndpointsSatisfied();
-    }
-
-    @Override
-    protected RouteBuilder createRouteBuilder() throws Exception {
-        return new RouteBuilder() {
-            public void configure() {
-                port1 = getPort();
-                port2 = getNextPort();
-
-                from("jetty:http://localhost:" + port1 + "?matchOnUriPrefix=true")
-                    .to("http://localhost:" + port2 + "?throwExceptionOnFailure=false&bridgeEndpoint=true&urlRewrite=#myRewrite");
-
-                from("jetty://http://localhost:" + port2 + "/bar").transform().simple("${header.phrase} ${body}").to("mock:result");
-            }
-        };
-    }
-
-}
diff --git a/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/MyUrlRewrite.java b/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/MyUrlRewrite.java
deleted file mode 100644
index 933102a..0000000
--- a/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/MyUrlRewrite.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.component.jetty;
-
-import org.apache.camel.Producer;
-import org.apache.camel.http.common.UrlRewrite;
-
-/**
- *
- */
-public class MyUrlRewrite implements UrlRewrite {
-
-    @Override
-    public String rewrite(String url, String relativeUrl, Producer producer) {
-        return url.replaceAll("foo", "bar");
-    }
-}
diff --git a/docs/components/modules/ROOT/pages/http-component.adoc b/docs/components/modules/ROOT/pages/http-component.adoc
index f305136..c2451e5 100644
--- a/docs/components/modules/ROOT/pages/http-component.adoc
+++ b/docs/components/modules/ROOT/pages/http-component.adoc
@@ -102,7 +102,7 @@ with the following path and query parameters:
 |===
 
 
-=== Query Parameters (51 parameters):
+=== Query Parameters (50 parameters):
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
@@ -127,7 +127,6 @@ with the following path and query parameters:
 | *transferException* (producer) | If enabled and an Exchange failed processing on the consumer side, and if the caused Exception was send back serialized in the response as a application/x-java-serialized-object content type. On the producer side the exception will be deserialized and thrown as is, instead of the HttpOperationFailedException. The caused exception is required to be serialized. This is by default turned off. If you enable this then be aware that Java will deserialize the  [...]
 | *cookieHandler* (producer) | Configure a cookie handler to maintain a HTTP session |  | CookieHandler
 | *okStatusCodeRange* (producer) | The status codes which are considered a success response. The values are inclusive. Multiple ranges can be defined, separated by comma, e.g. 200-204,209,301-304. Each range must be a single number or from-to with the dash included. | 200-299 | String
-| *urlRewrite* (producer) | *Deprecated* Refers to a custom org.apache.camel.component.http.UrlRewrite which allows you to rewrite urls when you bridge/proxy endpoints. See more details at \http://camel.apache.org/urlrewrite.html |  | UrlRewrite
 | *basicPropertyBinding* (advanced) | Whether the endpoint should use basic property binding (Camel 2.x) or the newer property binding with additional capabilities | false | boolean
 | *clientBuilder* (advanced) | Provide access to the http client request parameters used on new RequestConfig instances used by producers or consumers of this endpoint. |  | HttpClientBuilder
 | *clientConnectionManager* (advanced) | To use a custom HttpClientConnectionManager to manage connections |  | HttpClientConnectionManager