Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RabbitMqSendTracingAspect does not interfere in RestTemplate.invoke #48

Open
huehnerlady opened this issue Mar 12, 2020 · 5 comments
Open
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@huehnerlady
Copy link

huehnerlady commented Mar 12, 2020

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
Copy link
Author

Anybody? 😞

@ask4gilles
Copy link
Collaborator

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 ask4gilles added enhancement New feature or request help wanted Extra attention is needed labels Mar 26, 2020
@huehnerlady
Copy link
Author

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

@ask4gilles
Copy link
Collaborator

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

@zysaaa
Copy link

zysaaa commented Oct 15, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants