我使用this Camel示例作为参考,并将Initializer更改为扩展SpringBootServletInitializer
,以便我可以部署到JBoss EAP 6.4。
将其作为SpringBoot应用程序运行时:
/info
这样的Spring Actuator端点工作。 /health
甚至返回Camel Context的运行状况,但是像/routes
这样的Camel Actuator端点返回http 404。部署到JBoss时:
问题不是演示所特有的,我们在JBoss中运行的所有Containerized Camel Spring Boot应用程序都有同样的问题,而且很明显,这些应用程序完全是功能性的。
bootstrap.yml
camel:
springboot:
name: Demo
health:
check:
routes:
enabled: true
indicator:
enabled: true
endpoints:
actuator:
enabled: true
health:
enabled: true
management:
security:
enabled: false
的pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>demo</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.8.RELEASE</version>
<relativePath/>
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-spring-boot-starter</artifactId>
<version>2.20.0</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-stream-starter</artifactId>
<version>2.20.0</version>
</dependency>
</dependencies>
</project>
答案 0 :(得分:0)
在下面的 Application.yml 文件中使用。
camel:
springboot:
health.indicator.enabled:true
management:
security:
enabled:false