Skip to content

[type:perf] kafka logging: flush producer once per batch instead of p… - #7043

Open
renxf0319 wants to merge 1 commit into
apache:masterfrom
renxf0319:fix/kafka-logging-flush-per-batch
Open

[type:perf] kafka logging: flush producer once per batch instead of p…#7043
renxf0319 wants to merge 1 commit into
apache:masterfrom
renxf0319:fix/kafka-logging-flush-per-batch

Conversation

@renxf0319

Copy link
Copy Markdown

What this PR do

Optimize logging‑kafka plugin performance:

  • Move producer.flush() out of record loop, flush once per batch logs instead of per record.
  • Avoid frequent blocking flush, restore kafka producer batch capability.
  • Minor optimize: extract config map outside loop, add topic blank defensive check, adjust log level.

Background

The original code calls producer.flush() after every record send, which disables Kafka batch mechanism and seriously degrades gateway throughput.

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.

1 participant