首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >骆驼弹簧启动执行器不使用cxfrs路径

骆驼弹簧启动执行器不使用cxfrs路径
EN

Stack Overflow用户
提问于 2018-01-24 17:14:29
回答 1查看 1.2K关注 0票数 1

我已经使用springboot+camel开发了简单的基于cxfrs的路由,但是当我添加了spring启动器驱动器并将其作为@SpringBootApplication运行时:

Spring端点(如/health )不能工作,并返回HTTP404。

我的路线:

代码语言:javascript
复制
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

代码语言:javascript
复制
# 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/healthhttp://localhost:8080/camel/health上的状态。从日志中可以看到两个不同服务器的启动: jetty和tomcat。我们能否以这样一种方式配置: SpringBoot使用“cxf-rt-transports Jetty”,或者Camel cxfrs使用SpringBoot jetty“SpringBoot starter”。

如果我们在属性中提供management.port=8181,它就会抛出已经使用的端口。

EN

回答 1

Stack Overflow用户

发布于 2018-01-28 17:50:43

您可以通过在pom.xml中添加以下内容来添加springboot jetty,您必须排除默认的tomcat

代码语言:javascript
复制
<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> 
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/48428138

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档