第 4 章 迁移到 Apache Camel 3
本指南提供有关在 Spring Boot 上从 Red Hat Fuse 7 迁移到 Camel 3 的信息。
- 注意
在组件(如模块化和 XML 架构更改)中 Fuse 7 和 Camel 3 之间存在重要区别。详情请查看每个组件部分。
docs/modules/camel-spring-boot/camel-spring-boot-migration-guide/ref-migrating-to-camel-spring-boot-3.adoc == Java 版本 Camel 3 支持 Java 17 和 Java 11,但不支持 Java 8。
在 Java 11 中,JAXB 模块已从 JDK 中删除,因此您需要将它们添加为 Maven 依赖项(如使用 XML DSL 或 camel-jaxb 组件时)的 JAXB :
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.3.1</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-core</artifactId>
<version>2.3.0.1</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<version>2.3.2</version>
</dependency>
注意 :Java Platform, Standard Edition 11 Development Kit (JDK 11)在 Camel Spring Boot 3.x 版本中已弃用,且在以后的 4.x 版本中不被支持。
4.1. camel-core 的 Modularization 复制链接链接已复制到粘贴板!
在 Camel 3.x 中,camel-core 被分成多个 JAR,如下所示:
- camel-api
- camel-base
- camel-caffeine-lrucache
- camel-cloud
- camel-core
- camel-jaxp
- camel-main
- camel-management-api
- camel-management
- camel-support
- camel-util
- camel-util-json
Apache Camel 的 Maven 用户可以使用依赖项 camel-core,它对其所有模块的依赖关系进行传输,但 camel-main 除外,因此不需要迁移。