@EnableZipkinServer vs. @EnableZipkinStreamServer, why are two annotation for the same thing

huangapple go评论69阅读模式
英文:

@EnableZipkinServer vs. @EnableZipkinStreamServer, why are two annotation for the same thing

问题

我正在创建一个Zipkin服务器,并且我看过教程,其中在启动类上使用了@EnableZipkinServer注解,其他地方使用了@EnableZipkinStreamServer注解。我很难理解这两者之间的区别。它们是否可以互换使用?

英文:

I am creating a zipkin server, and i have seen tutorial which annotated the boostrap class with @EnableZipkinServer and others with @EnableZipkinStreamServer. I am having a hard time understand what is difference between these two. Are they interchangeable?

答案1

得分: 3

Zipkin是基于Spring Boot的项目,@EnableZipkinServer不是Spring Cloud的注解,而是Zipkin项目的一部分。这常常让那些刚接触Spring Cloud Sleuth和Zipkin的人感到困惑,因为Spring Cloud团队确实编写了@EnableZipkinStreamServer注解作为Spring Cloud Sleuth的一部分。@EnableZipkinStreamServer注解简化了使用RabbitMQ和Kafka与Zipkin的集成。

@EnableZipkinServer的优点在于设置的简便性。使用@EnableZipkinStreamServer时,您需要设置和配置要进行追踪的服务,以及配置Zipkin服务器以便将追踪数据发布/监听到RabbitMQ或Kafka。而@EnableZipkinStreamServer注解的优点在于,即使Zipkin服务器不可用,您仍然可以继续收集跟踪数据。这是因为跟踪消息将在消息队列中累积跟踪数据,直到Zipkin服务器可用于处理这些记录。如果您使用@EnableZipkinServer注解,而Zipkin服务器不可用,服务发送到Zipkin的跟踪数据将会丢失。

英文:

Zipkin is a Spring-Boot-based project, the @EnableZipkinServer is not a Spring Cloud annotation. It’s an annotation that’spart of the Zipkin project. This often confuses people who are new to the Spring Cloud Sleuth and Zipkin, because the Spring Cloud team did write the @EnableZipkinStreamServer annotation as part of Spring Cloud Sleuth. The @EnableZipkinStreamServer annotation simplifies the use of Zipkin with RabbitMQ and Kafka.

Advantages of @EnableZipkinServer is simplicity in setup. With the @EnableZipkinStream server you need to set up and configure the services being traced and the Zipkin server to publish/listen to RabbitMQ or Kafka for tracing data.The advantage of the @EnableZipkinStreamServer annotation is that you can continue to collect trace data even if the Zipkin server is unavailable. This is because the trace messages will accumulate the trace data on a message queue until the Zipkin server is available for processing the records. If you use the @EnableZipkinServer annotation and the Zipkin server is unavailable,the trace data that would have been sent by the service(s) to Zipkin will be lost.

huangapple
  • 本文由 发表于 2020年5月3日 16:22:12
  • 转载请务必保留本文链接:https://go.coder-hub.com/61571538.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定