搜索

2.18. Camel Spring Boot

download PDF

camel-spring-boot 依赖项不再包含 camel-spring-xml。要使用传统的 Spring XML 文件 &lt ;beans& gt;,在 Spring Boot 上带有 Camel,然后包含 camel-spring-boot-xml-starter 依赖项。

2.18.1. 正常关闭

Camel 现在会在 Spring Boot 关闭过程中关闭一些时间。这允许 Spring Boot graceful shutdown 首先完成(正常停止 Spring Boot HTTP 服务器),然后在 Camel 执行自己的 Graceful Shutdown 后。

从技术上 camel-spring 已将 getPhase ()Integer.MAX_VALUE 返回到 Integer.MAX_VALUE - 2049。这为 Spring Boot 服务提供了先关机的空间。

2.18.2. camel-micrometer-starter

uri 标签现在是静态的,而不是动态标签(默认情况下,因为 URI 使用动态值生成的标签太多)。这可以通过设置 camel.metrics.uriTagDynamic=true 来再次启用。

2.18.3. camel-platform-http-starter

platform-http-starter 已从使用 camel-servlet 改为直接使用 Spring HTTP 服务器。因此,所有 HTTP 端点不再以 servlet context-path 前缀(默认为 camel)。

例如:

from("platform-http:myservice")
  .to("...")

然后,在需要包括 context-path 之前调用 myservice 才能包括 context-path,如 http://localhost:8080/camel/myservice。现在,context-path 没有被使用,端点可以使用 http://localhost:8080/myservice 调用。

注意

platform-http-starter 也可以用于 Rest DSL。

如果路由或消费者被暂停,则 http status 503 现在会返回,而不是 404。

2.18.4. camel-twitter

组件已更新为使用 Twitter4j 版本 4.1.2,它已移动了几个类使用 的软件包。如果访问某些与二者相关的数据,如 Twit 状态,您需要将从 twitter4j.Status 中使用的软件包更新为 twitter4j.v1.Status

Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

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

让开源更具包容性

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

關於紅帽

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

© 2024 Red Hat, Inc.