spring-bootapache-cameljmxspring-camelspring-jmx

camel mbean management objects doesn't appear by default


I use camel 3.3.0 with spring boot 2.3.1. Considering documentation camel mbeans management objects for camel routes should be appeared by default, but it doesn't happen. I have tried to add to application.properties all properties with jmx, but it haven't helped too. application.properties

camel.component.jmx.customizer.enabled=true
camel.springboot.jmx-enabled=true
camel.component.jmx.enabled=true

I expect to see package org.apache.camel in Java Mission Control but I don't. I have old project with came. 2.x.x where everything works correctly. What do I do wrong?

pom.xml

..............................
<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>2.3.1.RELEASE</version>
    <relativePath/> <!-- lookup parent from repository -->
</parent>
..............................
<properties>
    <java.version>11</java.version>
</properties>
..............................
<dependency>
    <groupId>org.apache.camel.springboot</groupId>
    <artifactId>camel-spring-boot-starter</artifactId>
    <version>3.3.0</version>
</dependency>
<dependency>
    <groupId>org.apache.camel.springboot</groupId>
    <artifactId>camel-jmx-starter</artifactId>
    <version>3.3.0</version>
</dependency>
..................................

DemoApplication.java

@SpringBootApplication
public class DemoApplication extends RouteBuilder {

    public static void main(String[] args) {
        SpringApplication.run(DemoApplication.class, args);
    }

    @Override
    public void configure() throws Exception {
        from("activemq:queue:test").log("message from test");
    }

}

Solution

  • You need to add camel-management JAR as dependency to have Camel JMX enabled.

    Its also documented in the upgrade guide: https://camel.apache.org/manual/latest/camel-3x-upgrade-guide-3_1.html#_spring_boot_jmx