...
Name | Default Value | Description |
---|---|---|
|
| To use a custom |
|
| Refers to a file name to load as the configuration file. The file should be XML file. |
|
| Refers to a file name to load as the Apache mod_rewrite style based configuration file. This file should be a plain text file. |
|
| Is used to quickly configure a Apache mod_rewrite style based configuration without using a file. |
|
| Whether to use query strings in the url rewrite rules. |
|
| Whether to include context-path or not in the matching. Will be default remove the context-path. |
|
| Which match type to use. Can be either "wildcard" or "regex". |
|
| To use a specific encoding such as "utf-8" or "iso-8859-1". |
...
Component | Class |
---|---|
|
|
|
|
|
|
...
You setup the url rewrite as a bean of the type org.apache.camel.component.urlrewrite.http.HttpUrlRewrite
(when using HTTP component) as shown below: Wiki Markup
...
In the bean above we configure it with the configFile
option which is a XML UrlRewriteFilter configuration file. Wiki Markup
...
...
See more details at UrlRewriteFilter for how to configure the XML rules file.
In the Camel routes, you bridge the endpoints, and refer to the url rewrite on the producer endpoint as shown below. Notice how we refer to our url rewrite filter using the urlRewrite
option in the endpoint uri. Wiki Markup
Using load balancing eip
You can also use Camel's Load Balancer together with UrlRewrite, as shown below. In this code we use the failover load balancer, to failover to the 2nd endpoint (which goes to myapp3) in case of any exception thrown. Wiki Markup
Using Apache mod_rewrite style configuration
...
For example to configure the bean using the modRewriteConfFile property to refer to a mod configuration file:
...
...
Which then can contain mod rewrite rules and the likes: Wiki Markup
...
The url parameter contains the full url including scheme://hostname:port/path?query. The relativeUrl parameter is the url without the endpoint configured path. Notice this option may be null if the url doesn't start with the endpoint configured path. Wiki Markup Include Page