25.21. Spring Boot Auto-Configuration


在 Spring Boot 中使用 http 时,请确保使用以下 Maven 依赖项来支持自动配置:

<dependency>
  <groupId>org.apache.camel.springboot</groupId>
  <artifactId>camel-http-starter</artifactId>
</dependency>

组件支持 38 选项,它们如下所列。

Expand
名称Description默认类型

camel.component.http.allow-java-serialized-object

请求使用 context-type=application/x-java-serialized-object 时,是否允许 java serialization。默认情况下关闭。如果您启用此功能,Java 将把传入的数据从请求中反序列化为 Java,这可能会成为潜在的安全风险。

false

布尔值

camel.component.http.auth-caching-disabled

禁用身份验证方案缓存。

false

布尔值

camel.component.http.automatic-retries-disabled

禁用自动请求恢复和重新执行。

false

布尔值

camel.component.http.autowired-enabled

是否启用自动。这用于自动自动自动选项(选项必须标记为 autowired),方法是在 registry 中查找是否有匹配的类型实例,然后在组件上进行配置。这可用于自动配置 JDBC 数据源、JMS 连接工厂、AWS 客户端等。

true

布尔值

camel.component.http.client-connection-manager

使用自定义和共享 HttpClientConnectionManager 管理连接。如果已经进行了此配置,它将始终用于此组件创建的所有端点。选项为 org.apache.http.conn.HttpClientConnectionManager 类型。

 

HttpClientConnectionManager

camel.component.http.connect-timeout

决定在建立连接前的超时(毫秒)。超时值为零被解释为无限超时。超时值为零被解释为无限超时。负值解析为未定义(系统默认值)。

-1

整数

camel.component.http.connection-request-timeout

从连接管理器请求连接时使用的超时(毫秒)。超时值为零被解释为无限超时。超时值为零被解释为无限超时。负值解析为未定义(系统默认值)。

-1

整数

camel.component.http.connection-state-disabled

禁用连接跟踪。

false

布尔值

camel.component.http.connection-time-to-live

连接到 live 的时间,单位为 millisecond,默认值始终为live。

 

Long

camel.component.http.connections-per-route

每个路由的最大连接数。

20

整数

camel.component.http.content-compression-disabled

禁用自动内容解压缩。

false

布尔值

camel.component.http.cookie-management-disabled

禁用状态(cookie)管理。

false

布尔值

camel.component.http.cookie-store

使用自定义 org.apache.http.client.CookieStore。默认情况下,使用 org.apache.http.impl.client.BasicCookieStore,它是仅 Cookie 存储的内存。请注意,如果 bridgeEndpoint=true,则 Cookie 存储被强制用作 noop cookie 存储,因为我们只作为代理存储。选项是一个 org.apache.http.client.CookieStore 类型。

 

CookieStore

camel.component.http.copy-headers

如果这个选项为 true,则根据复制策略将 IN Exchange 标头复制到 OUT Exchange 标头。将其设置为 false,仅允许包括 HTTP 响应中的标头(不会传播 IN 标头)。

true

布尔值

camel.component.http.default-user-agent-disabled

如果用户未提供,则禁用此构建器设置的默认用户代理。

false

布尔值

camel.component.http.enabled

是否启用 http 组件的自动配置。默认启用。

 

布尔值

camel.component.http.header-filter-strategy

使用自定义 org.apache.camel.spi.HeaderFilterStrategy 过滤来自 Camel 消息的标头。选项是一个 org.apache.camel.spi.HeaderFilterStrategy 类型。

 

HeaderFilterStrategy

camel.component.http.http-binding

使用自定义 HttpBinding 控制 Camel 消息和 HttpClient 之间的映射。选项是一个 org.apache.camel.http.common.HttpBinding 类型。

 

HttpBinding

camel.component.http.http-client-configurer

使用自定义 HttpClientConfigurer 执行将使用的 HttpClient 的配置。选项是一个 org.apache.camel.component.http.HttpClientConfigurer 类型。

 

HttpClientConfigurer

camel.component.http.http-configuration

使用共享 HttpConfiguration 作为基本配置。选项是一个 org.apache.camel.http.common.HttpConfiguration 类型。

 

HttpConfiguration

camel.component.http.http-context

在执行请求时,使用自定义 org.apache.http.protocol.HttpContext。选项是一个 org.apache.http.protocol.HttpContext 类型。

 

HttpContext

camel.component.http.lazy-start-producer

制作者是否应该启动 lazy(在第一个消息上)。通过启动 lazy,您可以使用它来允许 CamelContext 和路由在启动期间启动,否则在启动期间出现问题,并导致路由启动失败。通过将这个启动延迟到 lazy 后,可以在通过 Camel 的路由错误处理程序路由消息期间处理启动失败。注意在处理第一个消息时,创建并启动制作者可能花费较少的时间,从而延长处理的总处理时间。

false

布尔值

camel.component.http.max-total-connections

连接的最大数量。

200

整数

camel.component.http.proxy-auth-domain

要使用的代理身份验证域。

 

字符串

camel.component.http.proxy-auth-host

代理身份验证主机.

 

字符串

camel.component.http.proxy-auth-method

要使用的代理验证方法。

 

字符串

camel.component.http.proxy-auth-nt-host

用于 NTML 的代理身份验证域(workstation 名称)。

 

字符串

camel.component.http.proxy-auth-password

代理验证密码。

 

字符串

camel.component.http.proxy-auth-port

代理身份验证端口.

 

整数

camel.component.http.proxy-auth-username

代理身份验证用户名.

 

字符串

camel.component.http.redirect-handling-disabled

禁用自动重定向处理。

false

布尔值

camel.component.http.response-payload-streaming-threshold

这个阈值以字节为单位控制响应有效负载是否应该以字节阵列的形式存储或基于流处理。将其设置为 -1 以始终使用 streaming 模式。

8192

整数

camel.component.http.skip-request-headers

是否跳过将所有 Camel 标头映射为 HTTP 请求标头。如果 HTTP 请求中不需要来自 Camel 标头的数据,则可以避免对 JVM 垃圾回收的许多对象分配进行解析。

false

布尔值

camel.component.http.skip-response-headers

是否跳过将所有 HTTP 响应标头映射到 Camel 标头。如果没有需要 HTTP 标头的数据,这样可以避免解析 JVM 垃圾回收的许多对象分配时的开销。

false

布尔值

camel.component.http.socket-timeout

以毫秒为单位定义套接字超时,即等待数据的超时时间不同,或以不同方式处理两个连续数据数据包之间的最大不活跃时间。超时值为零被解释为无限超时。负值解析为未定义(系统默认值)。

-1

整数

camel.component.http.ssl-context-parameters

使用 SSLContextParameters 配置安全性。重要信息:每个 HttpComponent 支持一个 org.apache.camel.support.jsse.SSLContextParameters 实例。如果您需要使用 2 个或更多不同的实例,则需要为每个实例定义一个新的 HttpComponent。选项是一个 org.apache.camel.support.jsse.SSLContextParameters 类型。

 

SSLContextParameters

camel.component.http.use-global-ssl-context-parameters

启用使用全局 SSL 上下文参数。

false

布尔值

camel.component.http.x509-hostname-verifier

使用自定义 X509HostnameVerifier,如 DefaultHostnameVerifier 或 NoopHostnameVerifier。选项是一个 javax.net.ssl.HostnameVerifier 类型。

 

HostnameVerifier

Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2026 Red Hat
返回顶部