...
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
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. |
| | Reference to a |
| | Username for Basic HTTP/NTML Authentication. |
| | Password for Basic HTTP/NTML Authentication. |
| | 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 *. |
| | 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.3: Setting options on HttpParam on both HttpClient and HttpClientConnectionManager. For instance |
| | Camel 2.3: To use a custom |
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 or newer
...
| | 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
Name | Type | Description |
---|---|---|
| | Camel 1.6.0: URI to call. Will override existing URI |
Message Headers
Camel 1.x
Name | Type | Description |
---|---|---|
| | Camel 1.5.1: URI to call. Will override existing URI set directly on the endpoint. Is set on the In message. |
| | The HTTP response code from the external server. Is 200 for OK. Is set on the Out message. |
| | URI parameters. Will override existing URI parameters set directly on the endpoint. Is set on the In message. |
Camel 2.0
| | The HTTP response code from the external server. Is 200 for OK. Is set on the Out message. |
| ||
Name | Type | Description |
---|---|---|
| | URI to callparameters. Will override existing URI parameters set directly on the endpoint. Is set on the In message. |
Camel 2.x
Name | Type | Description |
---|---|---|
| | URI to call. Will override existing URI set directly on the endpoint. |
| | Request URI's path. |
| | URI parameters. Will override existing URI parameters set directly on the endpoint. |
| | The HTTP response code from the external server. Is 200 for OK. |
| | Character encoding. |
| | The HTTP content type. Is set on both the IN and OUT message to provide a content type, such as |
| | The HTTP content encoding. Is set on both the IN and OUT message to provide a content encoding, such as |
| | From Camel 2.3.0, you can get the : The |
| | From Camel 2.3.0, you can get the : The |
Message Body
Camel will store the HTTP response from the external server on the OUT body. All headers from the IN message will be copied to the OUT message, so headers are preserved during routing. Additionally Camel will add the HTTP response headers as well to the OUT message headers.
...
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
Consult the Apache We can se the MaxConnectionsPerHost
option, which is named connectionsPerRoute
in HTTP Client 4.x documentation as HTTP Client 4.0 is configured much differently than the older 3.1.directly on the Camel HttpComponent
, which can be done as follows:
Code Block | ||||
---|---|---|---|---|
| ||||
<bean id="http" class="org.apache.camel.component.http.HttpComponent">
<property name="connectionsPerRoute" value="5"/>
</bean>
|
Using HTTPS to authenticate gotchas
...