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

Wrong tracer method is being called due to pointcut not being specific enough #58

Open
sasavilic opened this issue Nov 15, 2022 · 0 comments

Comments

@sasavilic
Copy link

We had internal fork of your library and in one of our projects we used MessagePostProcessor together with RabbitTemplate, like in example below:

String topic = "foo";
String payload = "bar";
rabbitTemplate.convertAndSend(topic, (Object)payload, postProcessor);

Sometimes code would work and sometimes we would get error, that our classes that implements MessagePostProcessor could not be serialized, because it is neither string, byte array not it implements serializable interface.

Upon deep dive, we noticed that method convertAndSend(String, String, Object) would be called instead of convertAndSend(String, Object, MessagePostProcessor).

We noticed that whenever correct or wrong method is called is somewhat random: depends on how method proxy cache is built. We noticed that both wrapper would match, it was only matter of which one comes first in cache. If it is convertAndSend(String, Object, MessagePostProcessor), then everything works fine, if not, then we get error.

We were able to create tiny project where similar behaviour can be reproduced and observed.

I would recommend to update your pointcut specification to also include required types.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant