我正在尝试设置spring cloud turbine amqp和hystrix仪表板。但是,当我启动所有应用程序时,hystrix仪表板不会向我显示任何内容: hystrix-dashboard-screenshot-link
但是当我打开涡轮流链接时,我看到的不是空数据: turbine-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
}
}
}
看起来问题出在依赖版本中。
答案 0 :(得分:0)
问题出在Edgware.RELEASE(和Edgware.SR1)版本中。它需要降级spring cloud版本(例如,降级到Dalston.SR5),或者使用Edgware.BUILD-SNAPSHOT。
说明:https://github.com/spring-cloud/spring-cloud-netflix/issues/2637