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

MessagingMessageListenerAdapter.determineInferredType not working when a custom annotation is present Kafka listener method argument #2052

Open
namelessone667 opened this issue Dec 20, 2021 · 2 comments

Comments

@namelessone667
Copy link

namelessone667 commented Dec 20, 2021

I have a kafka listener defined using @KafkaListener annotation with one input argument of type A.

If I add a customer annotation @annotation1 (for example for logging purposes) to this method argument then MessagingMessageListenerAdapter.determineInferredType returns type Object. When I remove my custom annotation then MessagingMessageListenerAdapter.determineInferredType return type A as expected.

The problem is probably with the condition on line 602:

if (!isNotConvertible && !isMessageWithNoTypeInfo(parameterType)
&& (methodParameter.getParameterAnnotations().length == 0
|| methodParameter.hasParameterAnnotation(Payload.class))) {

@artembilan
Copy link
Member

Would you mind to share with us a code which causes that problem?
Thanks

@garyrussell
Copy link
Contributor

As you can see with that if test - if you add other annotations, you must also explicitly add @Payload.

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

No branches or pull requests

3 participants