2 개의 매우 간단한 봄 구름 스트림 응용 프로그램이 있습니다. 메시지 생성자 인 Service3은 binder-kafka를 통해 소비자 인 Service4에 메시지를 보냅니다.spring-cloud-stream을 추적 할 수 없습니다. spring-cloud-sleuth가있는 Listener
그리고 저는 스프링 클라우드 - 룰루를 사용하여 스팬을 추적합니다. Zipkin 서버에서는 Service3의 범위 만 사용할 수 있습니다. Service4에 대한 스팬이 표시되지 않습니다.
서비스 3
dependencies { compile('org.springframework.boot:spring-boot-starter-web') compile('org.springframework.boot:spring-boot-starter-thymeleaf') compile('org.springframework.cloud:spring-cloud-starter-sleuth') // Marshal spans over a Spring cloud stream binder compile('org.springframework.cloud:spring-cloud-sleuth-stream') compile('org.springframework.cloud:spring-cloud-stream-binder-kafka') testCompile group: 'junit', name: 'junit', version: '4.11' } @SpringBootApplication public class Service3 { public static void main(String[] args) { SpringApplication.run(Service3.class, args); } } @Controller @EnableBinding(Source.class) public class WebController { @Autowired private Source source; @GetMapping("/srv4") private String getSrv4Info(){ String msg = "Hello Service 4"; this.source.output().send(MessageBuilder.withPayload(msg).build()); return "srv4"; } }
Service4 내가 그리워 했는가
dependencies { compile('org.springframework.boot:spring-boot-starter-web') compile('org.springframework.cloud:spring-cloud-starter-sleuth') // Marshal spans over a Spring cloud stream binder compile('org.springframework.cloud:spring-cloud-sleuth-stream') compile('org.springframework.cloud:spring-cloud-sleuth-zipkin-stream') compile('org.springframework.cloud:spring-cloud-stream-binder-kafka') runtime('io.zipkin.java:zipkin-autoconfigure-ui') testCompile group: 'junit', name: 'junit', version: '4.11' } @SpringBootApplication @EnableZipkinStreamServer public class Service4 { public static void main(String[] args) { SpringApplication.run(Service4.class, args); } } @EnableBinding(Sink.class) public class MsgReceiver { @StreamListener(Sink.INPUT) private void listen(Message<String> msg){ System.out.println(msg.getPayload()); } }
Servic4 (message consumer) is not traced
?
마지막으로 내 응용 프로그램과 관련된 2 가지 문제점을 발견했습니다. 1. @EnalbeZipkinStreamServer가있는 응용 프로그램을 추적 할 수 없습니다. 이것은 디자인에 의한 것 같습니다. – RocWay
그래, 우리가 추적자를 추적하고 싶지 않아서 디자인 상으로는 끝났어 –