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

Duplicate header processing in BatchMessagingMessageConverter#processRecord() #3589

Closed
borahm-lee opened this issue Oct 25, 2024 · 1 comment
Milestone

Comments

@borahm-lee
Copy link

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.

bky373 added a commit to bky373/spring-kafka that referenced this issue Oct 25, 2024
…eader issues `BatchMessagingMessageConverter`
bky373 added a commit to bky373/spring-kafka that referenced this issue Oct 25, 2024
bky373 added a commit to bky373/spring-kafka that referenced this issue Oct 25, 2024
sobychacko pushed a commit to sobychacko/spring-kafka that referenced this issue Oct 28, 2024
…ging/header issues

Remove unnecessary check

Fix checkstyle violation

Change log level from WARN to DEBUG

Refactor headers conversion method

Add natives condition for logging when no header mapper
@sobychacko sobychacko added this to the 3.3.0 milestone Nov 1, 2024
@sobychacko
Copy link
Contributor

PR merged.

sobychacko pushed a commit that referenced this issue Dec 24, 2024
Remove unnecessary check

Fix checkstyle violation

Change log level from WARN to DEBUG

Refactor headers conversion method

Add natives condition for logging when no header mapper
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants