HTTP
Send requests to external HTTP servers using Apache HTTP Client 5.x.
What’s inside
-
HTTP component, URI syntax:
http://httpUri -
HTTPS (Secure) component, URI syntax:
https://httpUri
Please refer to the above links for usage and configuration details.
Maven coordinates
<dependency>
<groupId>org.apache.camel.springboot</groupId>
<artifactId>camel-http-starter</artifactId>
</dependency> Spring Boot Auto-Configuration
The starter supports 54 options, which are listed below.
| Name | Description | Default | Type |
|---|---|---|---|
camel.component.http.allow-java-serialized-object | Whether to allow java serialization when a request uses context-type=application/x-java-serialized-object. This is by default turned off. If you enable this then be aware that Java will deserialize the incoming data from the request to Java and that can be a potential security risk. | false | Boolean |
camel.component.http.auth-caching-disabled | Disables authentication scheme caching | false | Boolean |
camel.component.http.automatic-retries-disabled | Disables automatic request recovery and re-execution. This is useful when a server responds with HTTP 429 (Too Many Requests) and includes a long Retry-After header, which would otherwise cause the client to wait (and appear to hang) before retrying. | false | Boolean |
camel.component.http.autowired-enabled | Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc. | true | Boolean |
camel.component.http.client-connection-manager | To use a custom and shared HttpClientConnectionManager to manage connections. If this has been configured then this is always used for all endpoints created by this component. The option is a org.apache.hc.client5.http.io.HttpClientConnectionManager type. | HttpClientConnectionManager | |
camel.component.http.connect-timeout | Determines the timeout (in millis) until a new connection is fully established. A timeout value of zero is interpreted as an infinite timeout. | 180000 | Long |
camel.component.http.connection-request-timeout | Returns the connection lease request timeout (in millis) used when requesting a connection from the connection manager. A timeout value of zero is interpreted as a disabled timeout. | 180000 | Long |
camel.component.http.connection-state-disabled | Disables connection state tracking | false | Boolean |
camel.component.http.connection-time-to-live | The time for connection to live, the time unit is millisecond, the default value is always keepAlive. | Long | |
camel.component.http.connections-per-route | The maximum number of connections per route. | 20 | Integer |
camel.component.http.content-compression-disabled | Disables automatic content decompression | false | Boolean |
camel.component.http.content-type-charset-enabled | Whether the Content-Type header should automatic include charset for string based content. | true | Boolean |
camel.component.http.cookie-management-disabled | Disables state (cookie) management | false | Boolean |
camel.component.http.cookie-store | To use a custom org.apache.hc.client5.http.cookie.CookieStore. By default the org.apache.hc.client5.http.cookie.BasicCookieStore is used which is an in-memory only cookie store. Notice if bridgeEndpoint=true then the cookie store is forced to be a noop cookie store as cookie shouldn’t be stored as we are just bridging (eg acting as a proxy). The option is a org.apache.hc.client5.http.cookie.CookieStore type. | CookieStore | |
camel.component.http.copy-headers | 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). | true | Boolean |
camel.component.http.default-user-agent-disabled | Disables the default user agent set by this builder if none has been provided by the user | false | Boolean |
camel.component.http.deserialization-filter | Sets an ObjectInputFilter pattern (jdk.serialFilter syntax) applied when deserializing Java objects from requests or responses with Content-Type application/x-java-serialized-object (only used when allowJavaSerializedObject or transferException is enabled). When not set, the JVM-wide jdk.serialFilter is used if present; otherwise a conservative default filter denying java.net. and otherwise allowing java., javax. and org.apache.camel. packages is applied. | String | |
camel.component.http.enabled | Whether to enable auto configuration of the http component. This is enabled by default. | Boolean | |
camel.component.http.follow-redirects | Whether to the HTTP request should follow redirects. By default the HTTP request does not follow redirects | false | Boolean |
camel.component.http.header-filter-strategy | To use a custom org.apache.camel.spi.HeaderFilterStrategy to filter header to and from Camel message. The option is a org.apache.camel.spi.HeaderFilterStrategy type. | HeaderFilterStrategy | |
camel.component.http.hostname-verification-policy | Controls how hostname verification is performed during the TLS handshake. CLIENT (default) delegates entirely to the configured x509HostnameVerifier, preserving the behaviour of httpclient 5.5 and earlier a NoopHostnameVerifier will disable verification. BUILTIN uses the JDK SSLParameters hostname check only, ignoring the configured verifier. BOTH runs the JDK built-in check first and then the configured verifier; a NoopHostnameVerifier cannot bypass the built-in check under BUILTIN or BOTH. Prefer BOTH when no custom verifier semantics are needed for stronger out-of-the-box security. | client | HostnameVerificationPolicy |
camel.component.http.http-activity-listener | To use a custom activity listener. The option is a org.apache.camel.component.http.HttpActivityListener type. | HttpActivityListener | |
camel.component.http.http-binding | To use a custom HttpBinding to control the mapping between Camel message and HttpClient. The option is a org.apache.camel.http.common.HttpBinding type. | HttpBinding | |
camel.component.http.http-client-configurer | To use the custom HttpClientConfigurer to perform configuration of the HttpClient that will be used. The option is a org.apache.camel.component.http.HttpClientConfigurer type. | HttpClientConfigurer | |
camel.component.http.http-configuration | To use the shared HttpConfiguration as base configuration. The option is a org.apache.camel.http.common.HttpConfiguration type. | HttpConfiguration | |
camel.component.http.http-context | To use a custom org.apache.hc.core5.http.protocol.HttpContext when executing requests. The option is a org.apache.hc.core5.http.protocol.HttpContext type. | HttpContext | |
camel.component.http.lazy-start-producer | Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel’s routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing. | false | Boolean |
camel.component.http.log-http-activity | To enable logging HTTP request and response. You can use a custom LoggingHttpActivityListener as httpActivityListener to control logging options. | false | Boolean |
camel.component.http.max-total-connections | The maximum number of connections. | 200 | Integer |
camel.component.http.non-proxy-hosts | Comma-separated list of hosts that should bypass the proxy. Supports wildcards, e.g., localhost,.example.com,192.168.. | String | |
camel.component.http.proxy-auth-domain | Proxy authentication domain to use with NTLM | String | |
camel.component.http.proxy-auth-method | Proxy authentication method to use (NTLM is deprecated) | String | |
camel.component.http.proxy-auth-nt-host | Proxy authentication domain (workstation name) to use with NTLM (NTLM is deprecated) | String | |
camel.component.http.proxy-auth-password | Proxy server password | String | |
camel.component.http.proxy-auth-scheme | Proxy server authentication protocol scheme to use | String | |
camel.component.http.proxy-auth-username | Proxy server username | String | |
camel.component.http.proxy-host | Proxy server host | String | |
camel.component.http.proxy-port | Proxy server port | Integer | |
camel.component.http.redirect-handling-disabled | Disables automatic redirect handling | false | Boolean |
camel.component.http.response-payload-streaming-threshold | This threshold in bytes controls whether the response payload should be stored in memory as a byte array or be streaming based. Set this to -1 to always use streaming mode. | 8192 | Integer |
camel.component.http.response-timeout | Determines the timeout (in millis) until arrival of a response from the opposite endpoint. A timeout value of zero is interpreted as an infinite timeout. Please note that response timeout may be unsupported by HTTP transports with message multiplexing. | Long | |
camel.component.http.skip-control-headers | Whether to skip Camel control headers (CamelHttp… headers) to influence this endpoint. Control headers from previous HTTP components can influence how this Camel component behaves such as CamelHttpPath, CamelHttpQuery, etc. | false | Boolean |
camel.component.http.skip-request-headers | Whether to skip mapping all the Camel headers as HTTP request headers. This is useful when you know that calling the HTTP service should not include any custom headers. | false | Boolean |
camel.component.http.skip-response-headers | Whether to skip mapping all the HTTP response headers to Camel headers. | false | Boolean |
camel.component.http.so-timeout | Determines the default socket timeout (in millis) value for blocking I/O operations. | 180000 | Long |
camel.component.http.ssl-bundle | The name of the Spring Boot SSL bundle to use for configuring SSL on the HTTP component. When set, the SSL bundle’s trust material and key material will be used to create the SSLContext for HTTPS connections. | String | |
camel.component.http.ssl-bundle-hot-reload | Whether to enable hot-reload of SSL certificates when the SSL bundle is updated. When enabled, certificate changes trigger recreation of the connection manager so new connections use the updated certificates. Requires the SSL bundle to have reload-on-update enabled in Spring Boot configuration. | false | Boolean |
camel.component.http.ssl-context-parameters | To configure security using SSLContextParameters. Important: Only one instance of org.apache.camel.support.jsse.SSLContextParameters is supported per HttpComponent. If you need to use 2 or more different instances, you need to define a new HttpComponent per instance you need. The option is a org.apache.camel.support.jsse.SSLContextParameters type. | SSLContextParameters | |
camel.component.http.use-global-ssl-context-parameters | Enable usage of global SSL context parameters. | false | Boolean |
camel.component.http.use-system-properties | To use System Properties as fallback for configuration for configuring HTTP Client | false | Boolean |
camel.component.http.user-agent | To set a custom HTTP User-Agent request header | String | |
camel.component.http.x509-hostname-verifier | To use a custom X509HostnameVerifier such as DefaultHostnameVerifier or NoopHostnameVerifier. The option is a javax.net.ssl.HostnameVerifier type. | HostnameVerifier | |
camel.component.http.proxy-auth-host | Proxy server host | String | |
camel.component.http.proxy-auth-port | Proxy server port | Integer |