我一直在做春云侦探,把痕迹推到zipkin,我们在spring-cloud-starter-stream-kafka和spring-cloud-sleuth-stream的帮助下把痕迹推到卡夫卡。
下面是我添加到应用程序中的依赖项
compile group: 'org.springframework.cloud', name: 'spring-cloud-starter-sleuth', version: '1.0.0.RELEASE'
compile group: 'org.springframework.cloud', name: 'spring-cloud-sleuth-stream', version: '1.2.4.RELEASE'
compile group: 'org.springframework.cloud', name: 'spring-cloud-starter-stream-kafka', version: '1.2.0.RELEASE'我的应用程序属性只有kafka broker,默认情况下,它将跟踪到sleuth主题spring.cloud.stream.kafka.binder.brokers=locahost:9092。
从现在起,一切都很好,,但是如果卡夫卡崩溃了,我还不能确定我们是否可以启动这个应用程序??。
从我看到的日志中,我看到应用程序启动了,但是由于它无法连接到kafka,我们将无法访问任何端点(在下面添加了一些日志)。寻找此解决方案,因为推送跟踪不是我的应用程序的主要功能。
Started testApp in 0.299 seconds (JVM running for 20.241)
[WARN] 2019-12-19 13:27:56,183 main org.apache.kafka.clients.producer.ProducerConfig - {} - The configuration 'key.deserializer' was supplied but isn't a known config.
[WARN] 2019-12-19 13:27:56,183 main org.apache.kafka.clients.producer.ProducerConfig - {} - The configuration 'value.deserializer' was supplied but isn't a known config.
[INFO] 2019-12-19 13:27:56,184 main org.apache.kafka.common.utils.AppInfoParser - {} - Kafka version : 0.11.0.0
[INFO] 2019-12-19 13:27:56,184 main org.apache.kafka.common.utils.AppInfoParser - {} - Kafka commitId : cb8625948210849f
[WARN] 2019-12-19 13:27:56,225 kafka-producer-network-thread | producer-1 org.apache.kafka.clients.NetworkClient - {} - Connection to node -1 could not be established. Broker may not be available.
[WARN] 2019-12-19 13:27:56,335 kafka-producer-network-thread | producer-1 org.apache.kafka.clients.NetworkClient - {} - Connection to node -1 could not be established. Broker may not be available.
[WARN] 2019-12-19 13:27:56,390 kafka-producer-network-thread | producer-1 org.apache.kafka.clients.NetworkClient - {} - Connection to node -1 could not be established. Broker may not be available.发布于 2019-12-19 08:24:24
你的版本错了。请不要自行设置版本,请使用Spring (spring-云依赖项)依赖关系管理,如下所示
buildscript {
dependencies {
classpath "io.spring.gradle:dependency-management-plugin:0.5.2.RELEASE"
}
}
apply plugin: "io.spring.dependency-management"
dependencyManagement {
imports {
mavenBom "org.springframework.cloud:spring-cloud-sleuth:${springCloudSleuthVersion}"
}
}
dependencies {
compile 'org.springframework.cloud:spring-cloud-starter-sleuth'
}而且-你只要加上新的开始就够了。您已经在给定版本中添加了一个启动程序,然后在另一个版本中添加了核心依赖项,这是没有意义的。
最后一件事-版本1.x被废弃,不再维护。当前版本为2.2.0,release和发布列车版本为Hoxton.RELEASE
https://stackoverflow.com/questions/59405521
复制相似问题