Skip to content

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

Open
@sasavilic

Description

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.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions