Skip to content

feat(kafka-logger): add cluster name support#4876

Merged
spacewander merged 6 commits into
apache:masterfrom
tzssangglass:kafka
Aug 26, 2021
Merged

feat(kafka-logger): add cluster name support#4876
spacewander merged 6 commits into
apache:masterfrom
tzssangglass:kafka

Conversation

@tzssangglass

Copy link
Copy Markdown
Member

What this PR does / why we need it:

about the cluster_name of kafka producer: https://github.com/doujiang24/lua-resty-kafka#new-1

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

Comment thread apisix/plugins/kafka-logger.lua Outdated
batch_max_size = {type = "integer", minimum = 1, default = 1000},
include_req_body = {type = "boolean", default = false}
include_req_body = {type = "boolean", default = false},
cluster_name = {type = "integer", default = 1},

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you need to limit the minimum value?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It confuses me, why name is an integer?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It confuses me, why name is an integer?

follow the origin design: https://github.com/doujiang24/lua-resty-kafka#new-1

The third optional cluster_name specifies the name of the cluster, default 1 (yeah, it's number). You can Specifies different names when you have two or more kafka clusters. And this only works with async producer_type.

I think using numbers should satisfy the need.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add it as a comment?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we highlight that this is a design in the documents?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Comment thread apisix/plugins/kafka-logger.lua Outdated
Comment thread apisix/plugins/kafka-logger.lua Outdated
batch_max_size = {type = "integer", minimum = 1, default = 1000},
include_req_body = {type = "boolean", default = false}
include_req_body = {type = "boolean", default = false},
cluster_name = {type = "integer", default = 1},

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add it as a comment?

@tokers

tokers commented Aug 25, 2021

Copy link
Copy Markdown
Contributor

@tzssangglass Please fix the conflicts.

@spacewander
spacewander merged commit 12596ba into apache:master Aug 26, 2021
@tzssangglass
tzssangglass deleted the kafka 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.

4 participants