49.3. Spring Boot Auto-Configuration
当在 Spring Boot 中使用 platform-http 时,请确保使用以下 Maven 依赖项来支持自动配置:
<dependency> <groupId>org.apache.camel.springboot</groupId> <artifactId>camel-platform-http-starter</artifactId> </dependency>
<dependency>
<groupId>org.apache.camel.springboot</groupId>
<artifactId>camel-platform-http-starter</artifactId>
</dependency>
组件支持 4 个选项,如下所列。
Name | 描述 | 默认值 | 类型 |
---|---|---|---|
camel.component.platform-http.autowired-enabled | 是否启用自动关闭。这用于自动关闭选项(选项必须标记为 autowired),方法是在 registry 中查找查找是否有单个匹配类型实例,然后在组件上配置。这可以用于自动配置 JDBC 数据源、JMS 连接工厂、AWS 客户端等。 | true | 布尔值 |
camel.component.platform-http.bridge-error-handler | 允许将消费者桥接到 Camel 路由错误处理程序,这意味着当消费者试图选择传入消息或类似信息时发生异常,现在将作为消息处理并由路由 Error Handler 处理。默认情况下,使用者将使用 org.apache.camel.spi.ExceptionHandler 来处理例外情况,该处理程序将被记录在 WARN 或 ERROR 级别,并忽略。 | false | 布尔值 |
camel.component.platform-http.enabled | 是否启用 platform-http 组件的自动配置。这默认是启用的。 | 布尔值 | |
camel.component.platform-http.engine | 为服务请求的 HTTP 服务器引擎实施。选项是 org.apache.camel.component.platform.http.spi.platformHttpEngine 类型。 | PlatformHttpEngine |
49.3.1. 实现反向代理 复制链接链接已复制到粘贴板!
平台 HTTP 组件可以充当反向代理,在这种情况下,有些标头填充了 HTTP 请求请求行中收到的绝对 URL。这些标头特定于更精简的平台。
目前,这个功能只支持 camel-platform-http-vertx
组件中的 Vert.x。