vamossagar12 commented on code in PR #15594:
URL: https://github.com/apache/kafka/pull/15594#discussion_r1539389617
##########
tests/kafkatest/services/connect.py:
##########
@@ -534,33 +535,40 @@ def received_messages(self):
def start(self):
self.logger.info("Creating connector VerifiableSinkConnector %s",
self.name)
- self.cc.create_connector({
+ connector_config = {
'name': self.name,
'connector.class':
'org.apache.kafka.connect.tools.VerifiableSinkConnector',
'tasks.max': self.tasks,
'topics': ",".join(self.topics)
- })
+ }
+ if self.consumer_group_protocol is not None:
+ connector_config["consumer.override.group.protocol"] =
self.consumer_group_protocol
+ self.cc.create_connector(connector_config)
class MockSink(object):
- def __init__(self, cc, topics, mode=None, delay_sec=10, name="mock-sink"):
+ def __init__(self, cc, topics, mode=None, delay_sec=10, name="mock-sink",
consumer_group_protocol=None):
self.cc = cc
self.logger = self.cc.logger
self.name = name
self.mode = mode
self.delay_sec = delay_sec
self.topics = topics
+ self.consumer_group_protocol = consumer_group_protocol
def start(self):
self.logger.info("Creating connector MockSinkConnector %s", self.name)
- self.cc.create_connector({
+ connector_config = {
'name': self.name,
'connector.class':
'org.apache.kafka.connect.tools.MockSinkConnector',
'tasks.max': 1,
'topics': ",".join(self.topics),
'mock_mode': self.mode,
'delay_ms': self.delay_sec * 1000
- })
+ }
+ if self.consumer_group_protocol is not None:
+ connector_config["consumer.override.group.protocol"] =
self.consumer_group_protocol
Review Comment:
Any config that we want to override on the consumer level for a sink
connector can be passed in by prefixing it with
`consumer.override.<config-name>` , the config name is `group.protocol` in this
case. I haven't had a chance to test this yet with the 3.8 release.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]