CCDAK practice question 12 of 25

You are using JDBC source connector to copy data from a table to Kafka topic. There is one connector created with max.tasks equal to 2 deployed on a cluster of 3 workers. How many tasks are launched?

Full set: 150 questions
Answer options
A: 3
B: 2
C: 1 Correct answer
D: 6
Correct Answer:
C. 1
Explanation

The tasks.max configuration in Kafka Connect sets the maximum number of tasks that can be created for a connector. However, the connector itself determines the actual number of tasks based on its ability to partition the source data. The JDBC Source Connector, when configured to query a single table without a specified incrementing or timestamp column (i.e., using the default mode='bulk'), cannot parallelize the query. The entire table is treated as a single unit of work. Therefore, even though tasks.max is set to 2, the connector can only create and use a single task to perform the data copy.

Why Incorrect

A. 3: The number of tasks is determined by the connector's partitioning logic and tasks.max, not by the number of available workers in the cluster.
B. 2: tasks.max is an upper limit, not a guaranteed number of tasks. The connector will create fewer tasks if the work cannot be logically divided.
D. 6: This value is likely a distractor derived from multiplying workers by tasks.max (3 2), which is not how Kafka Connect calculates task distribution.

References

1. Confluent Documentation, JDBC Source Connector for Kafka Connect:

Section: tasks.max configuration.

Content: "The maximum number of tasks for the JDBC source connector. This is used to scale up the number of tasks that will be used to read from a database. In some modes (e.g., bulk), the connector will not use more than one task." This explicitly states that in bulk mode, which is the default for a simple table copy, only one task is used.

Reference: Confluent, Inc. (2023). JDBC Source Connector for Kafka Connect Configuration Properties. https://docs.confluent.io/kafka-connectors/jdbc/current/source-connector/sourceconfigoptions.html#connector (Refer to the description for tasks.max).

2. Confluent Documentation, Kafka Connect Concepts:

Section: Tasks.

Content: "Source connectors can also be limited to a certain number of tasks regardless of how many partitions the topic has. The connector developer decides how to break down the job of pulling data from a source system into multiple tasks." This confirms that the connector's internal logic, not just the configuration, dictates the final task count.

Reference: Confluent, Inc. (2023). Kafka Connect - Concepts. https://docs.confluent.io/platform/current/connect/concepts.html#tasks.

Scroll to Top