Search code examples
javaspring-bootspring-cloudzipkin

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


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?


Solution

  • 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.