243.3. Spring Boot Auto-Configuration


组件支持 33 选项,如下所列。

Expand
Name描述默认值类型

camel.component.netty4-http.configuration.allow-default-codec

  

布尔值

camel.component.netty4-http.configuration.bridge-endpoint

如果选项为 true,则制作者将忽略 Exchange.HTTP_URI 标头,并使用端点的 URI 请求。您还可以将 throwExceptionOnFailure 设置为 false,以便生成者将所有故障响应发回。网桥模式中的消费者将跳过 gzip 压缩和 WWW URL 表单编码(通过将 Exchange.SKIP_GZIP_ENCODING 和 Exchange.SKIP_WW_FORM_URLENCODED 标头添加到被消耗的交换中)。

false

布尔值

camel.component.netty4-http.configuration.chunked-max-content-length

值(以字节为单位),每个块帧在 Netty HTTP 服务器上接收的最大内容长度。

1048576

整数

camel.component.netty4-http.configuration.compression

如果客户端支持来自 HTTP 标头的 gzip/deflate,则允许使用 gzip/deflate 在 Netty HTTP 服务器上压缩。

false

布尔值

camel.component.netty4-http.configuration.disable-stream-cache

确定来自 Netty HttpRequest#getContent ()或 HttpResponset#getContent ()的原始输入流是否被缓存,或者没有缓存(Camel 将流读到基于轻量级内存流缓存中的流中。)缓存。默认情况下,Camel 将缓存 Netty 输入流来支持多次读取它,以确保 Camel 可以从流检索所有数据。但是,当您需要访问原始流时,您可以将这个选项设置为 true,比如将其直接流传输到文件或其他持久性存储。请记住,如果您启用这个选项,则无法多次读取 Netty 流,您需要在 Netty 原始流上手动重置 reader 索引。另外,Netty 会在 Netty HTTP 服务器/HTTP 客户端完成处理时自动关闭 Netty 流,这意味着如果异步路由引擎正在使用异步路由,那么任何可能继续路由 org.apache.camel.Exchange 的异步线程可能无法读取 Netty 流,因为 Netty 已关闭。

false

布尔值

camel.component.netty4-http.configuration.host

本地主机名,如 localhost,或者在作为消费者时 0.0.0.0。使用制作者时的远程 HTTP 服务器主机名。

 

字符串

camel.component.netty4-http.configuration.map-headers

如果启用了这个选项,则在从 Netty 到 Camel Message 绑定时,也会映射标头(如将标头添加到 Camel 消息)。您可以关闭这个选项来禁用这个选项。仍可从 org.apache.camel.component.netty.http.NettyHttpMessage 消息访问标头,该消息返回 Netty HTTP 请求 io.netty.handler.codec.http.HttpRequest 实例。

true

布尔值

camel.component.netty4-http.configuration.match-on-uri-prefix

如果找不到完全匹配,Camel 是否应该尝试通过匹配 URI 前缀来查找目标消费者。

false

布尔值

camel.component.netty4-http.configuration.max-header-size

所有标头的最大长度。如果每个标头的长度总和超过这个值,则会引发 io.netty.handler.codec.TooLongFrameException。

8192

整数

camel.component.netty4-http.configuration.ok-status-code-range

被视为成功响应的状态代码。这些值包含为。可以定义多个范围,用逗号分开,如 200-204,209,301-304。每个范围都必须是一个数字或 from-to,包括横线。默认范围为 200-299

200-299

字符串

camel.component.netty4-http.configuration.path

资源路径

 

字符串

camel.component.netty4-http.configuration.port

端口号。是 https 的 http 和 443 的默认 80。

 

整数

camel.component.netty4-http.configuration.protocol

要使用的协议是 http 或 https

 

字符串

camel.component.netty4-http.configuration.send503when-suspended

消费者暂停时,是否发送 HTTP 状态代码 503。如果选项为 false,则 Netty Acceptor 在消费者暂停时为 unbound,因此客户端无法再连接。

true

布尔值

camel.component.netty4-http.configuration.throw-exception-on-failure

如果远程服务器失败响应,禁用禁用 HttpOperationFailedException 的选项。这样,无论 HTTP 状态代码是什么,您都可以获得所有响应。

true

布尔值

camel.component.netty4-http.configuration.transfer-exception

如果在消费者端启用并且 Exchange 失败,如果导致的 Exception 被发送序列化为 application/x-java-serialized-object 内容类型。在生成者一侧,异常将被反序列化和抛出,而不是 HttpOperationFailedException。导致异常需要被序列化。默认情况下是关闭的。如果启用此选项,则 Java 会将传入数据从请求反序列化到 Java,这可能会成为潜在的安全风险。

false

布尔值

camel.component.netty4-http.configuration.url-decode-headers

如果启用了这个选项,则在从 Netty 绑定到 Camel Message 时,标头值将被 URL 解码(例如 %20 将是一个空格字符。注意此选项供默认的 org.apache.camel.component.netty.http.NettyHttpBinding 使用,因此如果您实施自定义 org.apache.camel.component.netty4.http.NettyHttpBinding,则需要将标头相应地解码到这个选项。

false

布尔值

camel.component.netty4-http.configuration.use-relative-path

设置是否在 HTTP 请求中使用相对路径。

false

布尔值

camel.component.netty4-http.enabled

启用 netty4-http 组件

true

布尔值

camel.component.netty4-http.executor-service

使用给定的 EventExecutorGroup。选项是一个 io.netty.util.concurrent.EventExecutorGroup 类型。

 

字符串

camel.component.netty4-http.header-filter-strategy

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

 

字符串

camel.component.netty4-http.maximum-pool-size

EventExecutorGroup 的线程池大小(如果使用)。默认值为 16。

16

整数

camel.component.netty4-http.netty-http-binding

使用自定义 org.apache.camel.component.netty4.http.NettyHttpBinding 绑定到/从 Netty 和 Camel Message API 绑定。选项是 org.apache.camel.component.netty4.http.NettyHttpBinding 类型。

 

字符串

camel.component.netty4-http.resolve-property-placeholders

启动时组件是否应解析自身上的属性占位符。只有属于 String 类型的属性才能使用属性占位符。

true

布尔值

camel.component.netty4-http.security-configuration.authenticate

是否默认启用身份验证 <p/>。

 

布尔值

camel.component.netty4-http.security-configuration.constraint

支持的限制。<p/>当前只支持 Basic。

 

字符串

camel.component.netty4-http.security-configuration.login-denied-logging-level

设置一个日志记录级别,用于日志拒绝登录尝试(incl stacktraces)<p/>此级别默认为 DEBUG。

 

LoggingLevel

camel.component.netty4-http.security-configuration.realm

设置要使用的域的名称。

 

字符串

camel.component.netty4-http.security-configuration.role-class-name

  

字符串

camel.component.netty4-http.security-configuration.security-authenticator

设置 {@link SecurityAuthenticator},用于对 {@link HttpPrincipal} 进行身份验证。

 

SecurityAuthenticator

camel.component.netty4-http.security-configuration.security-constraint

设置 {@link SecurityConstraint} 用于检查 web 资源是否受限制或 <p/> 默认情况下,默认为 <tt>null</tt>,这意味着所有资源都受到限制。

 

SecurityConstraint

camel.component.netty4-http.ssl-context-parameters

使用 SSLContextParameters 配置安全性。选项是 org.apache.camel.util.jsse.SSLContextParameters 类型。

 

字符串

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

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

false

布尔值

返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

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

让开源更具包容性

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

關於紅帽

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

Theme

© 2025 Red Hat