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

GH-3589: Refactor toMessage batch method and fix logging/header issues #3590

Closed
wants to merge 6 commits into from

Conversation

bky373
Copy link
Contributor

@bky373 bky373 commented Oct 25, 2024

Description

  • Fixes: Duplicate header processing in BatchMessagingMessageConverter#processRecord() #3589
  • Remove duplicate logging and listenerInfo operation that occurs for each record in processRecord().
  • And refactor the tasks in toMessage() as follows:
    • addRecordInfo(): Adds information such as type, payload, key, etc. from the record to the given lists.
    • addToConvertedHeaders(): Adds the converted value of record.headers() to convertedHeaders.
    • Extract the value of the KafkaHeaders.LISTENER_INFO key from convertedHeaders, and put it to rawHeaders after the loop ends.
    • If there's no headerMapper, log a message so that users can refer to KafkaHeaders.NATIVE_HEADERS. As there's no need to check boolean logged every time in the loop, the logged variable has been removed, and the check for the existence of headerMapper and natives is now performed only once after the loop ends.

Note

Also, I changed the logging level from DEBUG to WARN when there is no header mapper. INFO might be better, please let me know what you think. -> Sorry, I'll keep DEBUG because it's logged every time the listener poll.

@sobychacko
Copy link
Contributor

Merged via 5fb1562.

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

Successfully merging this pull request may close these issues.

Duplicate header processing in BatchMessagingMessageConverter#processRecord()
2 participants