Camel Spring Boot Actuator Not Working with cxfrs route

ImranRazaKhan Source

I have developed simple cxfrs based route using springboot+camel, but when i added spring-boot-starter-actuator and running this as @SpringBootApplication:

The Spring Actuator endpoints like /health not working and return http 404.

My Route:

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

Update: if i add spring-boot-starter-web it shows status on http://localhost:8080/health or http://localhost:8080/camel/health. From logs it shows startup of two different servers jetty and tomcat. Can we configure in such a way that either SpringBoot use "cxf-rt-transports-http-jetty" or Camel cxfrs use SpringBoot Jetty "spring-boot-starter-jetty".

if we provide management.port=8181 in properties it throws port already in used.

spring-bootapache-cameljettycxfspring-boot-actuator

Answers

answered 9 months ago Zaheer #1

You can add springboot jetty by adding following in pom.xml, you have to exclude default 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> 

comments powered by Disqus