Skip to content

KIP 848:Extend DescribeConfigs and IncrementalAlterConfigs to support GROUP Config #1856

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

Merged
merged 5 commits into from
Apr 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/confluent_kafka/admin/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
CONFIG_SOURCE_DYNAMIC_DEFAULT_BROKER_CONFIG,
CONFIG_SOURCE_STATIC_BROKER_CONFIG,
CONFIG_SOURCE_DEFAULT_CONFIG,
CONFIG_SOURCE_GROUP_CONFIG,
RESOURCE_UNKNOWN,
RESOURCE_ANY,
RESOURCE_TOPIC,
Expand Down
1 change: 1 addition & 0 deletions src/confluent_kafka/admin/_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ class ConfigSource(Enum):
DYNAMIC_DEFAULT_BROKER_CONFIG = _cimpl.CONFIG_SOURCE_DYNAMIC_DEFAULT_BROKER_CONFIG #: Dynamic Default Broker
STATIC_BROKER_CONFIG = _cimpl.CONFIG_SOURCE_STATIC_BROKER_CONFIG #: Static Broker
DEFAULT_CONFIG = _cimpl.CONFIG_SOURCE_DEFAULT_CONFIG #: Default
GROUP_CONFIG = _cimpl.CONFIG_SOURCE_GROUP_CONFIG #: Group


class ConfigEntry(object):
Expand Down
2 changes: 2 additions & 0 deletions src/confluent_kafka/src/AdminTypes.c
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,8 @@ static void AdminTypes_AddObjectsConfigSource (PyObject *m) {
RD_KAFKA_CONFIG_SOURCE_STATIC_BROKER_CONFIG);
PyModule_AddIntConstant(m, "CONFIG_SOURCE_DEFAULT_CONFIG",
RD_KAFKA_CONFIG_SOURCE_DEFAULT_CONFIG);
PyModule_AddIntConstant(m, "CONFIG_SOURCE_GROUP_CONFIG",
RD_KAFKA_CONFIG_SOURCE_GROUP_CONFIG);
}


Expand Down
35 changes: 35 additions & 0 deletions tests/integration/admin/test_incremental_alter_configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
ConfigEntry, ResourceType, \
AlterConfigOpType

from tests.common import TestUtils


def assert_expected_config_entries(fs, num_fs, expected):
"""
Expand Down Expand Up @@ -147,3 +149,36 @@

# Assert expected config entries.
assert_expected_config_entries(fs, 1, expected)

# TODO: enable this test for the classic run too, when

Check notice on line 153 in tests/integration/admin/test_incremental_alter_configs.py

View check run for this annotation

SonarQube-Confluent / confluent-kafka-python Sonarqube Results

tests/integration/admin/test_incremental_alter_configs.py#L153

Complete the task associated to this "TODO" comment.
# Confluent Platform test cluster is upgraded to 8.0.0
if TestUtils.use_group_protocol_consumer():
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if TestUtils.use_group_protocol_consumer():
# TODO: enable this test for the classic run too, when
# Confluent Platform test cluster is upgraded to 8.0.0
if TestUtils.use_group_protocol_consumer():

group_id = "test-group"

res_group = ConfigResource(
ResourceType.GROUP,
group_id,
incremental_configs=[
ConfigEntry("consumer.session.timeout.ms", "50000",
incremental_operation=AlterConfigOpType.SET)
]
)

expected[res_group] = ['consumer.session.timeout.ms="50000"']

#
# Incrementally alter some configuration values
#
fs = admin_client.incremental_alter_configs([res_group])

assert_operation_succeeded(fs, 1)

time.sleep(1)

#
# Get current group config
#
fs = admin_client.describe_configs([res_group])

# Assert expected config entries.
assert_expected_config_entries(fs, 1, expected)