尝试创建 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
最佳答案
您好,看到您的屏幕截图,也许您使用的是 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/