我已经使用springboot+camel开发了简单的基于cxfrs的路由,但是当我添加了spring启动器驱动器并将其作为@SpringBootApplication运行时:
Spring端点(如/health )不能工作,并返回HTTP404。
我的路线:
from("cxfrs:http://127.0.0.1:8181?resourceClasses=org.imran.greenfarm.services.OrderService&bindingStyle=SimpleConsumer&providers=#jsonProvider&features=#featuresList")
.to("log:?showAll=true")
.toD("direct:${header.operationName}");application.properties
# all access to actuator endpoints without security
management.security.enabled = false
# turn on actuator health check
endpoints.health.enabled = true更新:,如果我添加spring starter,它将显示http://localhost:8080/health或http://localhost:8080/camel/health上的状态。从日志中可以看到两个不同服务器的启动: jetty和tomcat。我们能否以这样一种方式配置: SpringBoot使用“cxf-rt-transports Jetty”,或者Camel cxfrs使用SpringBoot jetty“SpringBoot starter”。
如果我们在属性中提供management.port=8181,它就会抛出已经使用的端口。
发布于 2018-01-28 17:50:43
您可以通过在pom.xml中添加以下内容来添加springboot jetty,您必须排除默认的tomcat
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jetty</artifactId>
</dependency> https://stackoverflow.com/questions/48428138
复制相似问题