1

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");
    }

}
typik89
  • 907
  • 1
  • 10
  • 23

1 Answers1

3

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

Claus Ibsen
  • 56,060
  • 7
  • 50
  • 65
  • Great, It works! Thank you very much. But I believe it should be the responsibility of some camel spring starter to include this dependency or not. Yes, I see this in the upgrade guide, but when I start new project with spring boot and camel 3.3.0 I read documentation and guides about spring boot camel and I see that by default everything should work. So I expect that this feature works by default or after adding some camel starter or updating properties in application.properties. – typik89 Jun 17 '20 at 11:26
  • Yeah if everything just works you would be without a job, and me too. Camel 3 is much more modular and so JMX is now 100% optional. To use it, add the dependency - as mentioned in the upgrade guide. – Claus Ibsen Jun 18 '20 at 18:27