【发布时间】:2018-07-03 19:58:32
【问题描述】:
我使用 springboot+camel 开发了简单的基于 cxfrs 的路由,但是当我添加 spring-boot-starter-actuator 并将其作为@SpringBootApplication 运行时:
像 /health 这样的 Spring Actuator 端点不起作用并返回 http 404。
我的路线:
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-boot-starter-web 它会在http://localhost:8080/health 或http://localhost:8080/camel/health 上显示状态。 从日志中它显示了两个不同服务器码头和 tomcat 的启动。我们可以这样配置SpringBoot使用“cxf-rt-transports-http-jetty”或Camel cxfrs使用SpringBoot Jetty“spring-boot-starter-jetty”。
如果我们在属性中提供 management.port=8181,则会抛出已使用的端口。
【问题讨论】:
标签: spring-boot apache-camel jetty cxf spring-boot-actuator