Skip to content

Duplicate header processing in BatchMessagingMessageConverter#processRecord() #3589

@borahm-lee

Description

@borahm-lee

In what version(s) of Spring for Apache Kafka are you seeing this issue?

For example:

  • 3.3.0-SNAPSHOT

Describe the bug

  • Originally, logs were supposed to be left once per record list when there is no headerMapper, but now they are left as many times as there are records.
  • Similarly, putting listenerInfo on rawHeaders is being attempted as many times as there are records.

To Reproduce

  • Run BatchMessageConverterTests#testNoMapper().

Expected behavior

  • It only logs once when there is no headerMapper.
  • Putting listenerInfo to rawHeaders is also attempted only once.

Sample

Currently, the logs in the code are at the DEBUG level, but I changed them to WARN for ease of reading.

  • Test before fixing:
    image

  • Test after fixing:
    image

I'm opening a PR right away to address this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions