camel-spring启动程序:org.apache.camel或org.apache.camel.springboot groupid?

ujv3wf0j  于 2021-07-26  发布在  Java
关注(0)|答案(1)|浏览(303)

根据camel上下文,我们可以使用这些:

<dependency>
    <groupId>org.apache.camel.springboot</groupId>
    <artifactId>camel-spring-boot</artifactId>
    <version>${camel.version}</version> <!-- use the same version as your Camel core version -->
</dependency>
<dependency>
    <groupId>org.apache.camel</groupId>
    <artifactId>camel-spring-boot-starter</artifactId>
    <version>${camel.version}</version> <!-- use the same version as your Camel core version -->
</dependency>

似乎没有错,maven也有手工艺品:
驼峰sb核心启动器::Spring启动启动器
Spring Boot启动器::camel::Spring Boot
一个应该同时使用两个(在同一个项目中)还是只使用一个?
否则什么时候用一个,什么时候用另一个,为什么?

7kqas0il

7kqas0il1#

如果您查看maven central的两个starter定义,您将看到 <groupId>org.apache.camel</groupId> 在camel 3之前使用 <groupId>org.apache.camel.springboot</groupId> 从 Camel 3号开始使用。
因此,根据您使用的camel版本,您应该使用 <groupId>org.apache.camel</groupId> 以防你被 Camel 2.x或 <groupId>org.apache.camel.springboot</groupId> 对于camel 3.x+

相关问题