opentracing-contrib / java-spring-rabbitmq

OpenTracing RabbitMQ instrumentation
Apache License 2.0
18 stars 21 forks source link

RabbitMqSendTracingAspect does not interfere in RestTemplate.invoke #48

Closed huehnerlady closed 3 weeks ago

huehnerlady commented 4 years ago

Hi,

we use the following snippet for publishing messages:

rabbitTemplate.invoke({ RabbitOperations operations ->
      operations.convertAndSend(<EXCHANGE>, null as String, payload, defaultPublishMessagePostProcessor)
      operations.waitForConfirmsOrDie(DEFAULT_WAIT_TIMEOUT_IN_MS)
      return true
    })

Unfortunately the class RabbitMqSendTracingAspect does just interfere with the sending options of the rest template, but seems not to work inside the invoke method. We need this snippet to ensure that the message we send actually arrived on rabbitMQ.

Is there any plans to enhance the Aspect to also be able to work with our snippet?

huehnerlady commented 4 years ago

Anybody? 😞

ask4gilles commented 4 years ago

Hi @huehnerlady , Sorry but I don't have the time to look at this for the moment. Feel free to submit a PR and I'll find the time to review it.

huehnerlady commented 4 years ago

@ask4gilles many thanks for your answer. Unfortunately I do not understand the Aspects well, but will see what I can do

ask4gilles commented 4 years ago

@huehnerlady alright, if you can come with something, I could find the time to help with that.

zysaaa commented 3 years ago

It seems that AOP will not work in this case even if you intercept RabbitTemplate#convertAndSend. See method invoke: image So this is sort of an internal call, check https://stackoverflow.com/questions/13564627/spring-aop-not-working-for-method-call-inside-another-method