Hello, !

Trying to play with Camel 3.5.0 and Opentracing on Springboot, with Elastic 
APM, with this simple route:

from("timer:hello?repeatCount=1&delay=1000").routeId("init")
        .setBody(constant(null))
        .setHeader(Exchange.HTTP_METHOD, constant(HttpMethods.POST))
        .setHeader(Exchange.HTTP_URI,constant("http://localhost:3000/answer";))
        .to("log:before call 1")
        .to("http://dummy";)
        .setBody(constant("dummyBody"))
        .setHeader(Exchange.HTTP_METHOD, constant(HttpMethods.GET))
        .setHeader(Exchange.HTTP_URI,constant("http://localhost:3000/answer";))
        .to("log:before call 2")
        .to("http://dummy";)
        ;

In this route, I first make a "POST" request, then a "GET" request.
I works fine as per my mock logs:

2020-09-24 14:55:52.789  INFO 104320 --- [           main] 
o.a.c.i.e.InternalRouteStartupManager    : Route: init started and consuming 
from: timer://hello
2020-09-24 14:55:52.795  INFO 104320 --- [           main] 
o.a.c.impl.engine.AbstractCamelContext   : Total 1 routes, of which 1 are 
started
2020-09-24 14:55:52.795  INFO 104320 --- [           main] 
o.a.c.impl.engine.AbstractCamelContext   : Apache Camel 3.5.0 (camel-1) started 
in 0.106 seconds
2020-09-24 14:55:52.802  INFO 104320 --- [           main] 
com.example.demo.DemoApplication         : Started DemoApplication in 2.239 
seconds (JVM running for 10.848)
2020-09-24 14:55:53.920  INFO 104320 --- [- timer://hello] before call 1        
                    : Exchange[ExchangePattern: InOnly, BodyType: null, Body: 
[Body is null]]
2020-09-24 14:55:54.071  INFO 104320 --- [- timer://hello] before call 2        
                    : Exchange[ExchangePattern: InOnly, BodyType: String, Body: 
dummyBody]

The mock logs confirms this, as we can see in the timestamps:

[cid:image001.png@01D69283.29BEA7A0]

However, in the APM logs of Kibana, I see this:

[cid:image002.png@01D69283.D9A74F00]
The HTTP operation are incorrect.
It seems (?) that the operation are based on the fact that the Exchange body is 
null or not. Is that the expected behavior ?

Thanks!

Reply via email to