104.10. Spring Boot Auto-Configuration
组件支持 67 个选项,如下所列。
| Name | 描述 | 默认值 | 类型 |
|---|---|---|---|
| camel.component.netty-http.allow-serialized-headers | 仅在 transferExchange 为 true 时用于 TCP。当设置为 true 时,标头和属性中的串行对象将添加到交换中。否则,Camel 将排除任何非序列化对象,并将其记录在 WARN 级别。 | false | 布尔值 |
| camel.component.netty-http.autowired-enabled | 是否启用自动关闭。这用于自动关闭选项(选项必须标记为 autowired),方法是在 registry 中查找查找是否有单个匹配类型实例,然后在组件上配置。这可以用于自动配置 JDBC 数据源、JMS 连接工厂、AWS 客户端等。 | true | 布尔值 |
| camel.component.netty-http.backlog | 允许为 netty consumer (server)配置积压。请注意,积压只是取决于操作系统的最佳努力。将此选项设置为值(如 200、500 或 1000)告知 TCP 堆栈如果未配置此选项,则接受队列的时长,则积压取决于操作系统设置。 | 整数 | |
| camel.component.netty-http.boss-count | 当 netty 适用于 nio 模式时,它使用 Netty 中的默认 bossCount 参数,即 1。用户可以使用此选项从 Netty 覆盖默认的 bossCount。 | 1 | 整数 |
| camel.component.netty-http.boss-group | 设置 BossGroup,可用于处理 NettyEndpoint 中服务器端的新连接。选项是一个 io.netty.channel.EventLoopGroup 类型。 | EventLoopGroup | |
| camel.component.netty-http.bridge-error-handler | 允许将消费者桥接到 Camel 路由错误处理程序,这意味着当消费者试图选择传入消息或类似信息时发生异常,现在将作为消息处理并由路由 Error Handler 处理。默认情况下,使用者将使用 org.apache.camel.spi.ExceptionHandler 来处理例外情况,该处理程序将被记录在 WARN 或 ERROR 级别,并忽略。 | false | 布尔值 |
| camel.component.netty-http.channel-group | 使用显式 ChannelGroup。选项是一个 io.netty.channel.group.ChannelGroup 类型。 | ChannelGroup | |
| camel.component.netty-http.client-initializer-factory | 使用自定义 ClientInitializerFactory。选项是 org.apache.camel.component.netty.ClientInitializerFactory 类型。 | ClientInitializerFactory | |
| camel.component.netty-http.configuration | 在创建端点时,使用 NettyConfiguration 作为配置。选项是 org.apache.camel.component.netty.NettyConfiguration 类型。 | NettyConfiguration | |
| camel.component.netty-http.connect-timeout | 等待套接字连接可用的时间。值以毫秒为单位。 | 10000 | 整数 |
| camel.component.netty-http.correlation-manager | 使用自定义关联管理器来管理在将请求/回复与 netty producer 搭配使用时如何映射请求和回复消息。只有在您有一个将请求与回复一起映射请求时(如请求和回复中有关联 ID)时,才应使用此设置。如果要在 netty 中的同一频道(也称为连接)上有多个并发消息,则可以使用它。当执行此操作时,您必须有一个与请求和回复相关的方法,以便在继续路由前将正确的回复存储在 inflight Camel Exchange 上。当您构建自定义关联管理器时,我们建议扩展 TimeoutCorrelationManagerSupport。这提供了对超时和其他复杂性的支持。如需了解更多详细信息,请参阅 producerPoolEnabled 选项。选项是 org.apache.camel.component.netty.NettyCamelStateCorrelationManager 类型。 | NettyCamelStateCorrelationManager | |
| camel.component.netty-http.decoders | 要使用的解码器列表。您可以使用以逗号分开的值的 String,并在 Registry 中查找值。只需记住使用 # 前缀,以便 Camel 知道它应该查找。 | 字符串 | |
| camel.component.netty-http.disconnect | 使用后是否从 Netty Channel 断开连接(关闭)。可用于使用者和制作者。 | false | 布尔值 |
| camel.component.netty-http.disconnect-on-no-reply | 如果启用了同步,则此选项将指定 NettyConsumer (如果它应该断开连接),没有回复回来。 | true | 布尔值 |
| camel.component.netty-http.enabled | 是否启用 netty-http 组件的自动配置。这默认是启用的。 | 布尔值 | |
| camel.component.netty-http.enabled-protocols | 使用 SSL 时要启用的协议。 | TLSv1.2,TLSv1.3 | 字符串 |
| camel.component.netty-http.encoders | 要使用的编码器列表。您可以使用以逗号分开的值的 String,并在 Registry 中查找值。只需记住使用 # 前缀,以便 Camel 知道它应该查找。 | 字符串 | |
| camel.component.netty-http.executor-service | 使用给定的 EventExecutorGroup。选项是一个 io.netty.util.concurrent.EventExecutorGroup 类型。 | EventExecutorGroup | |
| camel.component.netty-http.header-filter-strategy | 使用自定义 org.apache.camel.spi.HeaderFilterStrategy 来过滤标头。选项是一个 org.apache.camel.spi.HeaderFilterStrategy 类型。 | HeaderFilterStrategy | |
| camel.component.netty-http.hostname-verification | 要在 SSLEngine 上启用/禁用主机名验证。 | false | 布尔值 |
| camel.component.netty-http.keep-alive | 设置 以确保因为不活跃而不会关闭套接字。 | true | 布尔值 |
| camel.component.netty-http.key-store-file | 用于加密的客户端侧证书密钥存储。 | File | |
| camel.component.netty-http.key-store-format | 用于有效负载加密的密钥存储格式。如果没有设置,则默认为 JKS。 | 字符串 | |
| camel.component.netty-http.key-store-resource | 用于加密的客户端侧证书密钥存储。默认情况下从 classpath 加载,但您可以使用 classpath:、file: 或 http: 前缀来加载来自不同系统的资源。 | 字符串 | |
| camel.component.netty-http.lazy-channel-creation | 如果远程服务器在 Camel producer 启动时未启动并运行,则可以创建频道以避免异常。 | true | 布尔值 |
| camel.component.netty-http.lazy-start-producer | 生成者是否应懒惰启动 (在第一个消息中)。通过懒惰启动,您可以使用此选项来允许 CamelContext 和路由在生成者启动期间启动,并导致路由启动失败。通过懒惰启动,启动失败可以在路由信息时通过 Camel 的路由错误处理程序进行处理。请注意,在处理第一个消息时,创建并启动生成者可能需要稍等时间,并延长处理的总处理时间。 | false | 布尔值 |
| camel.component.netty-http.maximum-pool-size | 为 netty 消费者排序线程池设置最大线程池大小。默认大小为 2 x cpu_core 加 1。将此值设置为 10 时,除非 2 x cpu_core 加 1 是一个更高的值,否则将使用 10 个线程。例如,如果存在 8 个内核,则消费者线程池为 17。此线程池用于路由从 Camel 的 Netty 接收的消息。我们使用单独的线程池来确保消息排序,并在某些消息阻止时,nettys worker 线程(event 循环)不受影响。 | 整数 | |
| camel.component.netty-http.mute-exception | 如果启用并且在消费者端进行交换失败处理,响应的正文不包含异常的堆栈追踪。 | false | 布尔值 |
| camel.component.netty-http.native-transport | 是否使用原生传输而不是 NIO。原生传输利用主机操作系统,且仅在某些平台上受支持。您需要为正在使用的主机操作系统添加 netty JAR。有关更多信息,请访问: | false | 布尔值 |
| camel.component.netty-http.need-client-auth | 配置服务器在使用 SSL 时是否需要客户端身份验证。 | false | 布尔值 |
| camel.component.netty-http.netty-http-binding | 使用自定义 org.apache.camel.component.netty.http.NettyHttpBinding 来绑定到 Netty 和 Camel Message API。选项是 org.apache.camel.component.netty.http.NettyHttpBinding 类型。 | NettyHttpBinding | |
| camel.component.netty-http.netty-server-bootstrap-factory | 使用自定义 NettyServerBootstrapFactory。选项是 org.apache.camel.component.netty.NettyServerBootstrapFactory 类型。 | NettyServerBootstrapFactory | |
| camel.component.netty-http.no-reply-log-level | 如果启用了同步,这个选项会指示 NettyConsumer,在记录一个没有回复时要使用的日志记录级别。 | LoggingLevel | |
| camel.component.netty-http.options | 允许使用选项配置其他 netty 选项作为前缀。例如: option.child.keepAlive=false 设置 netty 选项 child.keepAlive=false。有关可以使用的选项,请参阅 Netty 文档。 | Map | |
| camel.component.netty-http.passphrase | 要使用 SSH 加密/解密有效负载的密码设置。 | 字符串 | |
| camel.component.netty-http.producer-pool-block-when-exhausted | 设置 blockWhenExhausted 配置属性的值。它决定在池耗尽时是否调用 borrowObject ()方法(达到的最大活跃对象数)。 | true | 布尔值 |
| camel.component.netty-http.producer-pool-enabled | producer 池是否已启用。重要:如果您关闭此设置,则为生成者使用单个共享连接,如果您执行请求/回复。这意味着,如果回复超出顺序,则存在交错响应潜在的问题。因此,您需要在请求和回复消息中有一个关联 ID,以便您可以将回复与负责继续处理 Camel 中消息的 Camel 回调关联。为此,您需要将 NettyCamelStateCorrelationManager 实施为关联管理器,并通过 correlationManager 选项进行配置。如需了解更多详细信息,请参阅 correlationManager 选项。 | true | 布尔值 |
| camel.component.netty-http.producer-pool-max-idle | 设置池中空闲实例数量上限。 | 100 | 整数 |
| camel.component.netty-http.producer-pool-max-total | 设置池可分配给客户端或闲置等待签出的对象数量上限。对没有限制,使用负值。 | -1 | 整数 |
| camel.component.netty-http.producer-pool-max-wait | 在池耗尽并且 producerPoolBlockWhenExhausted 为 true 时,borrowObject ()方法应在抛出异常前设置最长持续时间(值 millis )。当少于 0 时,borrowObject ()方法可能会无限期阻断。 | -1 | Long |
| camel.component.netty-http.producer-pool-min-evictable-idle | 设置对象在空闲对象驱除有资格驱除前,对象可能会在池中闲置的最小时间(值为 millis))。 | 300000 | Long |
| camel.component.netty-http.producer-pool-min-idle | 设置制作者池中允许的最小实例数量,然后再驱除线程(如果活跃)生成新对象。 | 整数 | |
| camel.component.netty-http.receive-buffer-size | 在入站通信中使用的 TCP/UDP 缓冲区大小。大小为字节。 | 65536 | 整数 |
| camel.component.netty-http.receive-buffer-size-predictor | 配置缓冲区大小预测。请参阅 Jetty 文档和此邮件线程的详细信息。 | 整数 | |
| camel.component.netty-http.request-timeout | 在调用远程服务器时,允许 Netty producer 使用超时。默认情况下,没有使用超时。该值在 milli 秒内,如 30000 为 30 秒。requestTimeout 使用 Netty 的 ReadTimeoutHandler 来触发超时。 | Long | |
| camel.component.netty-http.reuse-address | 设置 以方便套接字多路。 | true | 布尔值 |
| camel.component.netty-http.reuse-channel | 此选项允许生成者和消费者(在客户端模式中)在处理交换生命周期中重复使用相同的 Netty Channel。如果您需要在 Camel 路由中多次调用服务器并希望使用相同的网络连接,这非常有用。使用此选项时,频道不会返回到连接池,直到 Exchange 完成后;如果 disconnect 选项设为 true,则断开连接。重复使用的频道以一个交换属性的形式存储在 Exchange 中,它带有一个键 NettyConstants SerialNETTY_CHANNEL,它允许您在路由过程中获取频道并使用它。 | false | 布尔值 |
| camel.component.netty-http.security-configuration | 指的是 org.apache.camel.component.netty.http.NettyHttpSecurityConfiguration,用于配置安全 Web 资源。选项是 org.apache.camel.component.netty.http.NettyHttpSecurityConfiguration 类型。 | NettyHttpSecurityConfiguration | |
| camel.component.netty-http.security-provider | 用于有效负载加密的安全供应商。如果没有设置,则默认为 SunX509。 | 字符串 | |
| camel.component.netty-http.send-buffer-size | 在出站通信中使用的 TCP/UDP 缓冲大小。大小为字节。 | 65536 | 整数 |
| camel.component.netty-http.server-closed-channel-exception-caught-log-level | 如果服务器(NettyConsumer)捕获 java.nio.channels.ClosedChannelException,然后使用此日志级别进行记录。这用于避免记录关闭的频道异常,因为客户端可以立即断开,然后在 Netty 服务器中造成大量关闭的异常。 | LoggingLevel | |
| camel.component.netty-http.server-exception-caught-log-level | 如果服务器(NettyConsumer)捕获异常,则使用此日志级别进行日志记录。 | LoggingLevel | |
| camel.component.netty-http.server-initializer-factory | 使用自定义 ServerInitializerFactory。选项是 org.apache.camel.component.netty.ServerInitializerFactory 类型。 | ServerInitializerFactory | |
| camel.component.netty-http.ssl | 设置以指定是否将 SSL 加密应用到此端点。 | false | 布尔值 |
| camel.component.netty-http.ssl-client-cert-headers | 启用和 SSL 模式时,Netty 使用者将增强 Camel 消息,其中包含客户端证书的信息,如主题名称、签发者名称、序列号和有效日期范围。 | false | 布尔值 |
| camel.component.netty-http.ssl-context-parameters | 使用 SSLContextParameters 配置安全性。选项是 org.apache.camel.support.jsse.SSLContextParameters 类型。 | SSLContextParameters | |
| camel.component.netty-http.ssl-handler | 引用可用于返回 SSL 处理程序的类。选项是一个 io.netty.handler.ssl.SslHandler 类型。 | SslHandler | |
| camel.component.netty-http.sync | 将端点设置为单向或请求响应。 | true | 布尔值 |
| camel.component.netty-http.tcp-no-delay | 设置 以提高 TCP 协议性能。 | true | 布尔值 |
| camel.component.netty-http.transfer-exchange | 仅用于 TCP。您可以通过线线传输交换,而不是只传输正文。以下字段被传输: 在 body, Out body, fault body, In headers, Out headers, fault headers, Exchange properties, Exchange exception。这要求对象是序列化的。Camel 将排除任何非序列化对象,并将其记录在 WARN 级别。 | false | 布尔值 |
| camel.component.netty-http.trust-store-file | 用于加密的服务器端证书密钥存储。 | File | |
| camel.component.netty-http.trust-store-resource | 用于加密的服务器端证书密钥存储。默认情况下从 classpath 加载,但您可以使用 classpath:、file: 或 http: 前缀来加载来自不同系统的资源。 | 字符串 | |
| camel.component.netty-http.unix-domain-socket-path | 使用 unix 域套接字的路径,而不是 inet 套接字。但是,不需要使用主机和端口参数。为它们设置 dummy 值是正确的。必须与 nativeTransport=true 和 clientMode=false 一起使用。 | 字符串 | |
| camel.component.netty-http.use-global-ssl-context-parameters | 启用使用全局 SSL 上下文参数。 | false | 布尔值 |
| camel.component.netty-http.using-executor-service | 是否使用排序的线程池,确保同一通道上按顺序处理事件。 | true | 布尔值 |
| camel.component.netty-http.worker-count | 当 netty 适用于 nio 模式时,它会使用来自 Netty 的默认 workerCount 参数(即 cpu_core_threads x 2)。用户可以使用此选项从 Netty 覆盖默认的 workerCount。 | 整数 | |
| camel.component.netty-http.worker-group | 使用显式 EventLoopGroup 作为 boss 线程池。例如,要与多个消费者或生成者共享线程池。默认情况下,每个消费者或生成者都有自己的 worker 池,有 2 个 x cpu count 内核线程。选项是一个 io.netty.channel.EventLoopGroup 类型。 | EventLoopGroup |