Skip to content

feat: kafka-logger implemented reuse kafka producer#3429

Merged
spacewander merged 13 commits into
apache:masterfrom
tzssangglass:IssueNo3384
Jan 31, 2021
Merged

feat: kafka-logger implemented reuse kafka producer#3429
spacewander merged 13 commits into
apache:masterfrom
tzssangglass:IssueNo3384

Conversation

@tzssangglass

@tzssangglass tzssangglass commented Jan 26, 2021

Copy link
Copy Markdown
Member

What this PR does / why we need it:

When a topic has multiple partitions, the kafka-logger plugin creates a new producer instance to connect to kafka every time it pushes a message, which causes kafka to reallocate the partition each time, and all messages are placed in the same partition.

This PR reuse producer via lrucache to solve above problem.

fix #3384

Pre-submission checklist:

  • Did you explain what problem does this PR solve? Or what new features have been added?
  • Have you added corresponding test cases?
  • Have you modified the corresponding document?
  • Is this PR backward compatible? If it is not backward compatible, please discuss on the mailing list first

@tzssangglass

Copy link
Copy Markdown
Member Author

add test cases later

Comment thread apisix/plugins/kafka-logger.lua Outdated
get partition_id for test case and debug
Comment thread apisix/plugins/kafka-logger.lua
Comment thread apisix/plugins/kafka-logger.lua Outdated
Comment thread apisix/plugins/kafka-logger.lua Outdated
Comment thread apisix/plugins/kafka-logger.lua Outdated
Comment thread apisix/plugins/kafka-logger.lua
Comment thread apisix/plugins/kafka-logger.lua
Comment thread apisix/plugins/kafka-logger.lua Outdated
@tzssangglass

tzssangglass commented Jan 28, 2021

Copy link
Copy Markdown
Member Author

@spacewander @tokers @Firstsawyou CI is broken?

@spacewander

Copy link
Copy Markdown
Member

The CI is up now. You might need to submit a new commit to trigger it.

@tzssangglass

Copy link
Copy Markdown
Member Author

got

@tzssangglass

Copy link
Copy Markdown
Member Author

update, @spacewander @tokers @Firstsawyou pls take a look

Comment thread apisix/plugins/kafka-logger.lua Outdated
Comment thread apisix/plugins/kafka-logger.lua Outdated
@spacewander
spacewander merged commit d081620 into apache:master Jan 31, 2021
@tzssangglass
tzssangglass deleted the IssueNo3384 branch October 26, 2021 08:29
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.

request help: unbalanced message in kafka partition using kafka-logger plugin

4 participants