搜索

243.3. Spring Boot Auto-Configuration

download PDF

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

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_ENCODING 和 Exchange.SKIP_WWW_FORM_URLENCODED 标头到已消耗的交换)。

false

布尔值

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

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

1048576

整数

camel.component.netty4-http.configuration.compression

如果客户端从 HTTP 标头支持,则允许使用 gzip/定义在 Netty HTTP 服务器上压缩。

false

布尔值

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

确定来自 Netty HttpRequest CPUfreqgetContent ()或 HttpResponset"getContent ()的原始输入流是否被缓存(Camel 会将流读取到基于轻量级内存的流缓存)缓存中。默认情况下,Camel 将缓存 Netty 输入流,以支持多次读取,以确保其 Camel 可以从流检索所有数据。但是,当您需要访问原始流时,您可以将此选项设置为 true,例如将其直接流传输到文件或其他持久性存储。请注意,如果您启用这个选项,则无法多次读取 Netty 流,您需要手动重置 Netty 原始流上的读取器索引。另外,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。每个范围必须是单个数字,或从 到,其中包含短划线。默认范围为 200-299

200-299

字符串

camel.component.netty4-http.configuration.path

资源路径

 

字符串

camel.component.netty4-http.configuration.port

端口号。http 为 80,https 为 443。

 

整数

camel.component.netty4-http.configuration.protocol

使用的协议(http 或 https)

 

字符串

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

在使用者被暂停时,是否发送回 HTTP 状态代码 503。如果选项为 false,则 Netty Acceptor 在消费者被暂停时处于未绑定状态,因此客户端无法再连接。

true

布尔值

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

如果来自远程服务器的失败响应,用于禁用抛出 HttpOperationFailedException。这样,您可以获取所有响应,而不考虑 HTTP 状态代码。

true

布尔值

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

如果在消费者端启用并交换失败处理,如果原因 Exception 在响应中作为 application/x-java-serialized-object 内容类型发送序列化,则结果为 application/x-java-serialized-object 内容类型。在生产者侧,异常将反序列化并丢弃为原样,而不是 HttpOperationFailedException。原因异常需要按顺序处理。默认为关闭。如果您启用它,则 Java 会将传入的数据反序列化 Java 请求,这可能会成为潜在的安全风险。

false

布尔值

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

如果启用了这个选项,那么在从 Netty 绑定到 Camel Message 的过程中,标头值将被解码(例如 %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

支持的 restricted. <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 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

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

© 2024 Red Hat, Inc.