...
You can append query options to the URI in the following format, ?option=value&option=value&...
Info | ||
---|---|---|
| ||
Notice Camel 2.2 or older uses the Apache HTTP Client 3.1. We upgraded to HTTP Client 4.0.1 in Camel 2.3. This has an impact if you need advanced configuration as these two versions is much different how you do that. Consult the HTTP Client 4.x documentation. |
Info | ||
---|---|---|
| ||
You can only produce to endpoints generated by the HTTP component. Therefore it should never be used as input into your camel Routes. To bind/expose an HTTP endpoint via a HTTP server as input to a camel route, you can use the Jetty Component |
HttpEndpoint Options
| |
You can only produce to endpoints generated by the HTTP component. Therefore it should never be used as input into your camel Routes. To bind/expose an HTTP endpoint via a HTTP server as input to a camel route, you can use the Jetty Component |
HttpEndpoint Options
Name | Default Value | Description |
---|---|---|
| | Camel |
Name | Default Value | Description |
| | Camel 2.0: Option to disable throwing the |
| | Camel 2.1: If the option is true , HttpProducer will ignore the Exchange.HTTP_URI header, and use the endpoint's URI for request. You may also set the throwExcpetionOnFailure to be false to let the HttpProducer send all the fault response back. |
| | @deprecated: Reference to a |
| | Username for Basic HTTP/NTML Authentication. |
| | Password for Basic HTTP/NTML Authentication. |
Camel 2.3: Reference to a | ||
| | @deprecated: Reference to a |
| | Camel 2.1: Domain for NTML Authentication. This option must be used to force NTML authentication. |
| | The proxy host name * only for >= Camel 1.6.2 *. |
| | The proxy port number * only for >= Camel 1.6.2 *. |
3: Reference to a | ||
| | Setting options on the HttpClientParams. For instance |
| | Camel 2.3: To use a custom |
Camel 2.2 or older: Setting Authentication and Proxy
Name | Default Value | Description | ||
---|---|---|---|---|
| | Username for proxy authentication * only for >= Camel 1. 6.2 *. | ||
| | Password for proxy authentication * only for >= Camel 1.6. 2 *. | ||
| | Reference to a | ||
| | Camel 2.2 or older: Setting options on the HttpClientParams. For instance | ||
Camel 2.1: Domain for NTML Authentication. This option must be used to force NTML authentication. | ||||
| | Camel 1.6.2: The proxy host name | ||
| | Camel 1.6.2: The proxy port number | ||
| | Camel 1.6.2: Username for proxy authentication | ||
| | Camel 1.6.2: Password for proxy authentication | | |
Camel 2.3 or newer: Setting
...
Authentication and Proxy
Name | Default Value | Description |
---|---|---|
| | The proxy host name |
| | The proxy port number |
| | Authentication method, either as |
| | Username for authentication |
| | Password for authentication |
| | Domain for NTML authentication |
| | Optional host for NTML authentication |
| | Authentication method for proxy, either as |
| | Username for proxy authentication |
| | Password for proxy authentication |
When using authentication you must provide the choice of method for the authMethod
or authProxyMethod
options.
You can configure the proxy and authentication details on either the HttpComponent
or the HttpEndoint
. Values provided on the HttpEndpoint
will take precedence over HttpComponent
. Its most likely best to configure this on the HttpComponent
which allows you to do this once.
HttpComponent Options
Name | Default Value | Description |
---|---|---|
| | To use a custom |
| | To use a custom |
| | To use a custom |
| | Camel 2.3: To use a custom |
Notice that in Camel 2.3 the options on org.apache.camel.component.http.HttpConfiguration
is all provided as delegates on HttpComponent
so you easily can configure proxy and authentication details
...
clientConnectionManager
...
null
...
Camel 2.3: To use a custom org.apache.http.conn.ClientConnectionManager
.
HttpComponent Options
Name | Default Value | Description |
---|---|---|
| | Camel 2.3: Defines the maximum number of connections in total. |
| | Camel 2.3: Defines the maximum number of connections per route. |
| | Camel 2.3: To use a custom |
| | To use a custom |
| | To use a custom |
Camel 2.3 or newer
In Camel 2.3 we upgraded to use Apache HTTP Client 4.0.1 which is a major upgrade over the older Client 3.1 release. A significant change is that the HTTPClient
is using a shared HttpClientConnectionManager
as one giant thread pool. By default its configured to allow 200 concurrent threads. That means you cannot use different options for the HttpClientConnectionManager
. If you for some odd reason want that you can define a 2nd CamelHttpComponent
and let it use a different configured HttpClientConnectionManager
.
Message Headers
Camel 1.x
...
Setting MaxConnectionsPerHost
...
The Http Component has a org.apache.commons.httpclient.HttpConnectionManager
where you can configure various global configuration for the given component.
By global, we mean that any endpoint the component creates has the same shared HttpConnectionManager
. So, if we want to set a different value for the max connection per host, we need to define it on the HTTP component and not on the endpoint URI that we usually use. So here comes:
...
Wiki Markup |
---|
{snippet:id=e2|lang=xml|url=camel/tags/camel-2.2.0/tests/camel-itest/src/test/resources/org/apache/camel/itest/http/HttpMaxConnectionPerHostTest-context.xml} |
Camel 2.3 or newer
We can se the MaxConnectionsPerHost
option, which is named connectionsPerRoute
in HTTP Client 4.x directly on the Camel HttpComponent
, which can be done as follows:
Code Block | ||
---|---|---|
xml | xml | <bean id="http" class="org.apache.camel.component.http.HttpComponent"> <property name="connectionsPerRoute" value="5"/> </bean> tags/camel-2.2.0/tests/camel-itest/src/test/resources/org/apache/camel/itest/http/HttpMaxConnectionPerHostTest-context.xml} |
Using HTTPS to authenticate gotchas
...