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

Kafka Connect: Add config to prefix the control consumer group #11599

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

hugofriant
Copy link

@hugofriant hugofriant commented Nov 20, 2024

I would like to control the name of the control consumer group to have more fine grained accesses when deploying the Iceberg Sink connector on my infrastructure.

This PR aims to replace the DEFAULT_CONTROL_GROUP_PREFIX by a configurable variable

@@ -77,6 +77,7 @@ for exactly-once semantics. This requires Kafka 2.5 or later.
| iceberg.table.\<table name\>.partition-by | Comma-separated list of partition fields to use when creating the table |
| iceberg.table.\<table name\>.route-regex | The regex used to match a record's `routeField` to a table |
| iceberg.control.topic | Name of the control topic, default is `control-iceberg` |
| iceberg.control.group-id-prefix | Prefix for the control consuler group, default is `cg-control` |
Copy link
Member

Choose a reason for hiding this comment

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

There's a type here: I guess you mean consumer (not consuler :)).

I would rather name this property iceberg.control.consumer-group-id-prefix to keep the kafka semantic.

@@ -80,6 +80,7 @@ public class IcebergSinkConfig extends AbstractConfig {
private static final String TABLES_SCHEMA_CASE_INSENSITIVE_PROP =
"iceberg.tables.schema-case-insensitive";
private static final String CONTROL_TOPIC_PROP = "iceberg.control.topic";
private static final String CONTROL_GROUP_PREFIX_PROP = "iceberg.control.group-id-prefix";
Copy link
Member

Choose a reason for hiding this comment

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

As suggested before, I would use consumer-group-id-prefix.

@jbonofre
Copy link
Member

@bryanck @rdblue I reviewed this PR and worked with @hugofriant on nit changes. I think this PR is ready to be merged 😄 Can you please take a look as well ? Thanks !

@jbonofre
Copy link
Member

@RussellSpitzer I reviewed this PR and worked with @hugofriant on nit changes. I think this PR is ready to be merged 😄 Can you also please take a look (and merge) ? Thanks !

@@ -80,6 +80,7 @@ public class IcebergSinkConfig extends AbstractConfig {
private static final String TABLES_SCHEMA_CASE_INSENSITIVE_PROP =
"iceberg.tables.schema-case-insensitive";
private static final String CONTROL_TOPIC_PROP = "iceberg.control.topic";
private static final String CONTROL_GROUP_ID_PREFIX_PROP = "iceberg.control.consumer-group-id-prefix";
Copy link
Contributor

Choose a reason for hiding this comment

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

We should name this iceberg.control.group-id-prefix which is more consistent (and shorter).

Copy link
Member

Choose a reason for hiding this comment

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

It was the first proposal, but I proposed to keep the consumer-group semantic. OK for just group.

Copy link
Contributor

@bryanck bryanck Nov 21, 2024

Choose a reason for hiding this comment

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

I think it's OK to shorten it, e.g. Kafka's consumer property is group.id.

ConfigDef.Type.STRING,
DEFAULT_CONTROL_GROUP_PREFIX,
Importance.LOW,
"Prefix of the control consumer group, should not be set under normal conditions");
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it is reasonable to set this, so I'd make this Prefix of the control consumer group

@@ -359,6 +366,9 @@ public String controlTopic() {
return getString(CONTROL_TOPIC_PROP);
}

public String prefixControlConsumerGroup() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Rename to controlGroupIdPrefix

Copy link
Member

Choose a reason for hiding this comment

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

Again, it was the first proposal, I asked for consumer to clear with the kafka semantic.

@bryanck
Copy link
Contributor

bryanck commented Nov 21, 2024

Thanks for the PR @hugofriant , I had just a few naming nits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants