spring-boot - camel mbean 管理对象默认不出现
问题描述
我使用camel 3.3.0和spring boot 2.3.1。考虑到camel路由的文档camel mbeans管理对象应该默认出现,但它不会发生。我尝试使用 jmx 将所有属性添加到 application.properties,但它也没有帮助。应用程序属性
camel.component.jmx.customizer.enabled=true
camel.springboot.jmx-enabled=true
camel.component.jmx.enabled=true
我希望org.apache.camel
在 Java Mission Control 中看到包,但我没有。我有一个旧项目。2.xx 一切正常。我做错了什么?
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");
}
}
解决方案
您需要添加camel-management
JAR 作为依赖项才能启用 Camel JMX。
它还记录在升级指南中:https ://camel.apache.org/manual/latest/camel-3x-upgrade-guide-3_1.html#_spring_boot_jmx
推荐阅读
- python - 暂停任务队列
- django - 直接执行自定义SQL不起作用但没有报错
- c# - 创建两个具有相同变量但具有不同访问方法的类的最佳方法
- list - Powershell:将文本文件的值作为列表列出
- python - serial.serialutil.SerialException: 无法打开端口 'COM3': FileNotFoundError(2, '系统找不到指定的文件。', None, 2)
- python - 计算 DataFrame 中多个对象的切片均值
- reactjs - this.props 在组件 ReactJS 的第一次调度操作后变得未定义
- java - 如何为基于 Java 的 Spring Boot 项目调用内部 Python 服务
- python - 使用熊猫的时间序列数据更改数据框的问题
- c++ - 当函数参数和返回类型都是引用时,是否将参数复制到结果临时?