我正在尝试设置 spring 云涡轮 amqp 和 hystrix 仪表板。但是当我启动所有应用程序时,hystrix 仪表板没有显示任何内容: hystrix-dashboard-screenshot-link
但是当我打开涡轮流链接时,我看到的不是空数据: turtle-stream-data-screenshot-link
当我停止涡轮服务并运行示例时:https ://github.com/spring-cloud-samples/turbine
它正在工作: working-hystrix-dashboard-screenshot-link
所以,问题出在我的涡轮机服务中。这是 TurbineApplication.java:
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.turbine.stream.EnableTurbineStream;
@EnableTurbineStream
@SpringBootApplication
public class TurbineApplication {
public static void main(String[] args) {
SpringApplication.run(TurbineApplication.class, args);
}
}
这是 application.yml:
server:
port: ${PORT:8989}
eureka:
user:
name: "{cipher}6c627b546202f13ffa9e3edf39974a3bfca5d615f58dcbfc23065661968b13c5"
password: "{cipher}75efd89c7c4d79220a5b3f35e9ad692a69c820fa0b99e9c48ae9433d45ba016db808ab9dce78382235e529291f8aa0be"
instance:
preferIpAddress: true
client:
registerWithEureka: true
fetchRegistry: true
serviceUrl:
defaultZone: http://${eureka.user.name}:${eureka.user.password}@127.0.0.1:8761/eureka/
这是 bootstrap.yml:
spring:
application:
name: turbine-service
这是 gradle.build:
buildscript {
ext {
springBootVersion = '1.5.9.RELEASE'
dockerPluginVersion = '1.2'
}
repositories {
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
classpath("se.transmode.gradle:gradle-docker:${dockerPluginVersion}")
}
}
apply plugin: 'java'
apply plugin: 'docker'
apply plugin: 'eclipse'
apply plugin: 'org.springframework.boot'
group = 'com.pda'
jar {
baseName = 'turbine-service'
version = 'latest'
}
sourceCompatibility = 1.8
repositories {
mavenCentral()
}
ext {
springCloudVersion = 'Edgware.RELEASE'
}
dependencies {
compile('org.springframework.boot:spring-boot-starter-actuator')
compile('org.springframework.boot:spring-boot-starter-web')
compile('org.springframework.cloud:spring-cloud-starter-turbine-stream')
compile('org.springframework.cloud:spring-cloud-starter-stream-rabbit')
}
dependencyManagement {
imports {
mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}"
}
}
eclipse {
classpath {
containers.remove('org.eclipse.jdt.launching.JRE_CONTAINER')
containers 'org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8'
}
}
task buildDocker(type: Docker, dependsOn: build) {
push = false
applicationName = jar.baseName
dockerfile = file('src/main/docker/Dockerfile')
doFirst {
copy {
from jar
into stageDir
}
}
}
看起来问题出在依赖版本中。