spring-boot - Zipkin UI 显示错误消息 'ERROR: cannot load service names: No message available'

标签 spring-boot spring-cloud-stream zipkin

尝试创建 zipkin 服务器,并在 gradle 中添加依赖项,如下所示,

compile ("org.springframework.cloud:spring-cloud-starter-zipkin")
compile ("org.springframework.amqp:spring-rabbit")
compile('io.zipkin.java:zipkin-autoconfigure-ui')

另外,

我在 application.properties 和 bootstrap.properties 文件中添加了属性,例如,

application.properties

server.port=8085

bootstrap.properties

spring.application.name=zipkin-server

一旦我启动服务器并加载 UI 页面,我就会在 UI 中收到错误,如下所示: enter image description here

最佳答案

您好,看到您的屏幕截图,也许您使用的是 Spring Boot 2.x 版本,我在使用 Finchley.RELEASE 的 Spring Boot 2.0.3 时遇到了同样的问题。

我发现 Zipkin 自定义服务器不再受支持并已被弃用,因此无法在 Spring Cloud 代码中使用 @EnableZipkinServer 并且您拥有 ui,但没有配置服务器端、api 端点等。

形成 Zipkin 基本代码:

/**
 * @deprecated Custom servers are possible, but not supported by the community. Please use our
 * <a href="https://github.com/openzipkin/zipkin#quick-start">default server build</a> first. If you
 * find something missing, please <a href="https://gitter.im/openzipkin/zipkin">gitter</a> us about
 * it before making a custom server.
 *
 * <p>If you decide to make a custom server, you accept responsibility for troubleshooting your
 * build or configuration problems, even if such problems are a reaction to a change made by the
 * OpenZipkin maintainers. In other words, custom servers are possible, but not supported.
 */
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Import(InternalZipkinConfiguration.class)
@Deprecated
public @interface EnableZipkinServer {

}

代码可在 official repo of Zipkin 上获取 我使用官方 docker 镜像和 compose 解决了我的问题

version: '3.1'

services:
  rabbitmq:
    image: rabbitmq:3-management
    restart: always
    ports:
      - 5672:5672
      - 15671:15671
      - 15672:15672
    networks:
      - messaging

  zipkin-server:
    image: openzipkin/zipkin
    ports:
      - 9065:9411
    environment:
      - zipkin.collector.rabbitmq.uri=amqp://guest:guest@rabbitmq:5672
    networks:
      - messaging

networks:
  messaging:
    driver: bridge

你如何看到我使用流媒体版本。它对我有用

希望对你有帮助

关于spring-boot - Zipkin UI 显示错误消息 'ERROR: cannot load service names: No message available',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50027127/

相关文章:

java - 是否可以使用 Spring Cloud Config 将复杂的配置传递给 Spring Cloud Stream 函数

azure - 如何在 Spring Boot 中为 CosmosDb 设置分区键

基于 Spring Security 一次性密码 (OTP) 的登录

angular - SockJS over stomp 使用 angular2 和 spring boot

kotlin - Spring Cloud Stream Kotlin消费者问题

spring-cloud - 使用新版本 Chelsea.RC1 的 "condition paramter header"@StreamListener 时出错

spring - 跨线程发送 TraceId

Spring 侦探 |创建全新的(分离的/孤立的)Trace

spring-boot - 创建名称为 'rabbitListenerContainerFactory' 的 bean 时出错

java - spring boot 微服务给出 : java.net.SocketException:连接重置