Skip to content

StringJsonMessageConverter doesn't work with List<Message<PO>> #601

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

Closed
realcbb opened this issue Mar 16, 2018 · 1 comment
Closed

StringJsonMessageConverter doesn't work with List<Message<PO>> #601

realcbb opened this issue Mar 16, 2018 · 1 comment
Assignees
Milestone

Comments

@realcbb
Copy link
Contributor

realcbb commented Mar 16, 2018

StringJsonMessageConverter works well with Message<PO> as method parameter when using @KafkaListener, but doesn't work with List<Message<PO>> in batch listener mode. Already set factory.setMessageConverter(new BatchMessagingMessageConverter(jsonMessageConverter));.
It seems that the listener does not using StringJsonMessageConverter to convert each record when the message parameter isMessageList.

@garyrussell
Copy link
Contributor

garyrussell commented Mar 16, 2018

Confirmed.

Do you really need the complete messages?

This works...

@KafkaListener(...)
public void listen1(List<Foo> foos, @Header(KafkaHeaders.RECEIVED_TOPIC) List<String> topics,
		@Header(KafkaHeaders.RECEIVED_PARTITION_ID) List<Integer> partitions) {
    ...
}

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

2 participants