Author: buildbot Date: Thu Sep 10 09:18:35 2015 New Revision: 964964 Log: Production update by buildbot for camel Modified: websites/production/camel/content/cache/main.pageCache websites/production/camel/content/http4.html Modified: websites/production/camel/content/cache/main.pageCache ============================================================================== Binary files - no diff available. Modified: websites/production/camel/content/http4.html ============================================================================== --- websites/production/camel/content/http4.html (original) +++ websites/production/camel/content/http4.html Thu Sep 10 09:18:35 2015 @@ -96,7 +96,7 @@
camel-http4 vs camel-http
Camel-http4 uses Apache HttpClient 4.x while camel-http uses Apache HttpClient 3.x.
Will by default use port 80 for HTTP and 443 for HTTPS.
You can append query options to the URI in the following format, ?option=value&option=value&...
camel-http4 vs camel-jetty
You can only produce to endpoints generated by the HTTP4 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, use the Jetty Component instead.
Name | Default Value | Description |
---|---|---|
|
| The maximum number of connections. |
|
| The maximum number of connections per route. |
|
| Camel 2.11.2/2.12.0: To use a custom |
|
| Reference to a |
|
| To use a custom |
|
| To use a custom |
|
| Camel 2.9.2: To use a custom |
|
| Camel 2.8: To use a custom |
|
| Camel 2.7: You can refer to a different |
|
| Camel 2.11.0: The time for connection to live, the time unit is millisecond, the default value is always keep alive. |
Name | Default Value | Description |
---|---|---|
|
| Opt
ion to disable throwing the |
|
| If 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 fault responses back. Also if set to true HttpProducer and CamelServlet will skip the gzip processing if the content-encoding is "gzip". |
|
| Camel 2.11.2/2.12.0: Whether to clear expired cookies before sending the HTTP request. This ensures the cookies store does not keep growing by adding new cookies which is newer removed when they are expired. |
|
| Camel 2.11.2/2.12.0: To use a custom |
|
| DefaultHttpBinding will copy the request input stream into a stream cache and put it into the message body if this option is false to support multiple reads, otherwise DefaultHttpBinding will set the request input stream directly in the message body. |
|
| Camel 2.10.4: Reference to a instance of |
|
| Deprecated and will be removed in Camel 3.0: Reference to a |
|
| To use a custom |
|
| Deprecated and will be removed in Camel 3.0: Reference to a |
|
| Reference to a |
|
| Deprecated and will be removed in Camel 3.0: Camel 2.9.2: Reference to a custom |
|
| Camel 2.9.2: To use a custom |
|
| Setting options on the BasicHttpParams. For instance Since Camel 2.13.0: httpClient is changed to configure the HttpClientBuilder and RequestConfig.Builder, please check out API document for a complete reference. |
|
| To use a custom |
|
| If enabled and an Exchange failed processing on the consumer side, and if the caused |
|
| Deprecated and will be removed in Camel 3.0: Camel 2.8: Reference to a |
|
| Camel 2.11.1: Reference to a |
|
|
Camel 2.7: You can refer to a different |
|
| Camel 2.11: Producer only Refers to a custom |
|
| Camel 2.14: The maximum number of total connections that the connection manager has. If this option is not set, camel will use the component's setting instead. |
|
| Camel 2.14: The maximum number of connections per route. If this option is not set, camel will use the component's setting instead. |
|
| Camel 2.11.3/2.12.2: If this option is true, camel-http4 sends preemptive basic authentication to the server. |
eagerCheckContentAvailable | false | Camel 2.16: Consumer only Whether to eager check whether the HTTP requests has content if the content-length header is 0 or not present. This can be turned on in case HTTP clients do not send streamed data. |
copyHeaders | true | |
okStatusCodeRange | 200-299 | Camel 2.16: The status codes which is considered a success response. The values are inclusive. The range must be defined as from-to with the dash included. |
The following authentication options can also be set on the HttpEndpoint:
Before Camel 2.8.0
Name | Default Value | Description |
---|---|---|
|
| Username for authentication. |
|
| Password for authentication. |
|
| The domain name for authentication. |
|
| The host name authentication. |
|
| The proxy host name |
|
| The proxy port number |
|
| Username for proxy authentication |
|
| Password for proxy authentication |
|
| The proxy domain name |
|
| The proxy Nt host name |
Since Camel 2.8.0
Name | Default Value | Description |
---|---|---|
|
| Username for authentication |
|
| Password for authentication |
|
| The domain name for authentication |
|
| The host name authentication |
|
| The proxy host name |
|
| The proxy port number |
|
| The proxy scheme, will fallback and use the scheme from the endpoint if not configured. |
|
| Username for proxy authentication |
|
| Password for proxy authentication |
|
| The proxy domain name |
|
| The proxy Nt host name |
Name | Type | Description |
---|---|---|
|
| URI to call. Will override existing URI set directly on the endpoint. |
|
| Request URI's path, the header will be u sed to build the request URI with the HTTP_URI. |
|
| 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 |
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.
Camel will handle according to the HTTP response code:
HttpOperationFailedException
with the information.Response code is 400+, Camel regards it as an external server failure and will throw a HttpOperationFailedException
with the information.
throwExceptionOnFailure
The option, throwExceptionOnFailure
, can be set to false
to prevent the HttpOperation
FailedException
from being thrown for failed response codes. This allows you to get any response from the remote server.
There is a sample below demonstrating this.
This exception contains the following information:
java.lang.String
, if server provided a body as responseThe following algorithm is used to determine whether the GET
or POST
HTTP method should be used:
1. Use method provided in header.
2. GET
if query string is provided in header.
3. GET
if endpoint is configured wi
th a query string.
4. POST
if there is data to send (body is not null).
5. GET
otherwise.
You can get access to these two using the Camel type converter system using
NOTE You can get the request and response not just from the processor after the camel-jetty or camel-cxf endpoint.
Will by default use port 80 for HTTP and 443 for HTTPS.
You can append query options to the URI in the following format, ?option=value&option=value&...
camel-http4 vs camel-jetty
You can only produce to endpoints generated by the HTTP4 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, use the Jetty Component instead.
Name | Default Value | Description |
---|---|---|
|
| The maximum number of connections. |
|
| The maximum number of connections per route. |
|
| Camel 2.11.2/2.12.0: To use a custom |
|
| Reference to a |
|
| To use a custom |
|
| To use a custom |
|
| Camel 2.9.2: To use a custom |
|
| Camel 2.8: To use a custom |
|
| Camel 2.7: You can refer to a different |
|
| Camel 2.11.0: The time for connection to live, the time unit is millisecond, the default value is always keep alive. |
Name | Default Value | Description |
---|---|---|
|
| Opt
ion to disable throwing the |
|
| If 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 fault responses back. Also if set to true HttpProducer and CamelServlet will skip the gzip processing if the content-encoding is "gzip". |
|
| Camel 2.11.2/2.12.0: Whether to clear expired cookies before sending the HTTP request. This ensures the cookies store does not keep growing by adding new cookies which is newer removed when they are expired. |
|
| Camel 2.11.2/2.12.0: To use a custom |
|
| DefaultHttpBinding will copy the request input stream into a stream cache and put it into the message body if this option is false to support multiple reads, otherwise DefaultHttpBinding will set the request input stream directly in the message body. |
|
| Camel 2.10.4: Reference to a instance of |
|
| Deprecated and will be removed in Camel 3.0: Reference to a |
|
| To use a custom |
|
| Deprecated and will be removed in Camel 3.0: Reference to a |
|
| Reference to a |
|
| Deprecated and will be removed in Camel 3.0: Camel 2.9.2: Reference to a custom |
|
| Camel 2.9.2: To use a custom |
|
| Setting options on the BasicHttpParams. For instance Since Camel 2.13.0: httpClient is changed to configure the HttpClientBuilder and RequestConfig.Builder, please check out API document for a complete reference. E.g. since this version use |
|
| To use a custom |
|
| If enabled and an Exchange failed processing on the consumer side, and if the caused |
|
| Deprecated and will be removed in Camel 3.0: Camel 2.8: Reference to a |
|
| Camel 2.11.1: Reference to a |
|
| Camel 2.7: You can refer to a different |
|
| Camel 2.11: Producer only Refers to a custom |
|
| Camel 2.14: The maximum number of total connections that the connection manager has. If this option is not set, camel will use the component's setting instead. |
|
| Camel 2.14: The maximum number of connections per route. If this option is not set, camel will use the component's setting instead. |
|
| Camel 2.11.3/2.12.2: If this option is true, camel-http4 sends preemptive basic authentication to the server. |
eagerCheckContentAvailable | false | Camel 2.16: Consumer only Whether to eager check whether the HTTP requests has content if the content-length header is 0 or not present. This can be turned on in case HTTP clients do not send streamed data. |
copyHeaders | true | Camel 2.16: If this option is true then IN exchange headers will be copied to OUT exchange headers according to copy strategy. Setting this to false, allows to only include the headers from the HTTP response (not propagating IN headers). |
okStatusCodeRange | 200-299 | Camel 2.16: The status codes which is considered a success response. The values are inclusive. The range must be defined as from-to with the dash included. |
The following authentication options can also be set on the HttpEndpoint:
Before C amel 2.8.0
Name | Default Value | Description |
---|---|---|
|
| Username for authentication. |
|
| Password for authentication. |
|
| The domain name for authentication. |
|
| The host name authentication. |
|
| The proxy host name |
|
| The proxy port number |
|
| Username for proxy authentication |
|
| Password for proxy authentication |
|
| The proxy domain name |
|
| The proxy Nt host name |
Since Camel 2.8.0
Name | Default Value | Description |
---|---|---|
|
| Username for authentication |
|
| Password for authentication |
|
| The domain name f or authentication |
|
| The host name authentication |
|
| The proxy host name |
|
| The proxy port number |
|
| The proxy scheme, will fallback and use the scheme from the endpoint if not configured. |
|
| Username for proxy authentication |
|
| Password for proxy authentication |
|
| The proxy domain name |
|
| The proxy Nt host name |
Name | Type | Description |
---|---|---|
|
| URI to call. Will override existing URI set directly on the endpoint. |
| Request URI's path, the header will be used to build the request URI with the HTTP_URI. | |
|
| 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 |
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.
Camel will handle according to the HTTP response code:
HttpOperationFailedException
with the information.Response code is 400+, Camel regards it as an external server failure and will throw a HttpOperationFailedException
with the information.
throwExceptionOnFailure
T
he option, throwExceptionOnFailure
, can be set to false
to prevent the HttpOperationFailedException
from being thrown for failed response codes. This allows you to get any response from the remote server.
There is a sample below demonstrating this.
This exception contains the following information:
java.lang.String
, if server provided a body as responseThe following algorithm is used to determine whether the GET
or POST
HTTP method should be used:
1. Use method provided in header.
2. GET
if query string is provided in header.
3. GET
if endpoint is configured with a query string.
4. POST
if there is data to send (body is not null).
5. GET
otherwise.
You can get access to these two using the Camel type converter system using
NOTE You can get the request and response not just from the processor after the camel-jetty or camel-cxf endpoint.
See the HttpSOTimeoutTest unit test.
The HTTP4 component provides a way to configure a proxy.
See the HttpSOTimeoutTest unit test.
Since Camel 2.13.0: See the updated HttpSOTimeoutTest unit test.
The HTTP4 component provides a way to configure a proxy.