java-spring-rabbitmq
java-spring-rabbitmq copied to clipboard
RabbitMqSendTracingAspect does not interfere in RestTemplate.invoke
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?
Anybody? 😞
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.
@ask4gilles many thanks for your answer. Unfortunately I do not understand the Aspects well, but will see what I can do
@huehnerlady alright, if you can come with something, I could find the time to help with that.
It seems that AOP will not work in this case even if you intercept RabbitTemplate#convertAndSend
. See method invoke
:
So this is sort of an internal call, check https://stackoverflow.com/questions/13564627/spring-aop-not-working-for-method-call-inside-another-method