1

I have 2 services A and B. I'm calling an endpoint in B from A using Spring Integration with Spring Boot 2.1.4.

<groupId>io.opentracing.contrib</groupId>
<artefactId>opentracing-spring-jaeger-web-starter</artefactId>
<version>3.1.1</version>

<groupId>io.opentracing.contrib</groupId>
<artefactId>opentracing-spring-cloud-starter</artefactId>
<version>0.5.5</version>
package  a.b.c;
public interface AGateway{
    @Gateway(requestChannel="abc", replyChannel="def")
    @Payload("'''")
    String hitAPIofB(@Header(value="id",required=true) String id);
}
<int:gateway id="gateway1" service-interface="a.b.c.AGateway">
<int:channel id="abc">
<int:channel id="def">

<int-http:outbound-gateway http-method="GET" url="http://host:port/apiOfB" request-channel="abc" reply-channel="def" extract-request-payload="true" expected-response-type="java.lang.String" reply-timeout="5000">
</int-http:outbound-gateway>
@RequestMapping(value="/apiOfB", method=GET)
@ResponseBody
public String apiOfB(@RequestHeader final Map<String, String> headers){
    String id=headers.get("id");
    return id+String.valueOf(Math.random());
}

In service A logs:

Span reported: a3d21f16b50eba4180dbe072a4749c48:acaac182f155d8f1:1519ab433e329c40:1 - receive:def

In service B logs:

Span reported  : 6d58a582dc540713:6d58a582dc540713:0:1 - apiOfB

Clearly traceId is different in service B.

I think due to this, I'm not seeing the service B span under service A span in JaegerUi.

Any idea what I'm doing wrong?

dur
  • 15,689
  • 25
  • 79
  • 125
Rahul
  • 637
  • 5
  • 16

0 Answers0