Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The existing method that builds consumer properties is modified to detect `group.protocol=share` and construct `KafkaShareConsumer` configs instead of `KafkaConsumer` configs:

``````java
// In Worker.java
static Map<String, Object> baseConsumerConfigs(...) {
    Map<String, Object> consumerProps = new HashMap<>();
    
    String groupProtocol = // resolve from worker + connector config
    
    if ("share".equals(groupProtocol)) {
        consumerProps.put(ShareConsumerConfig.GROUP_ID_CONFIG, 
            connConfig.getString("share.group.id", SinkUtils.consumerGroupId(connName)));
        // Share consumer specific configs
        consumerProps.put(ShareConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, config.bootstrapServers());
        // No ENABLE_AUTO_COMMIT -- share groups don't have this concept
 
      // No AUTO_OFFSET_RESET -- share groups start from the share partition start offset
    } else {
        // existing consumer group config path (unchanged)
        consumerProps.put(ConsumerConfig.GROUP_ID_CONFIG, SinkUtils.consumerGroupId(connName));
        consumerProps.put(ConsumerConfig.ENABLE_AUTO_COMMIT_CONFIG, "false");
        // ...
    }
    return consumerProps;
}
```

Metrics

These sensors are only registered by `WorkerShareSinkTask` -- they are not present when using a traditional `KafkaConsumer` via `WorkerSinkTask`.

This avoids publishing meaningless zeros and keeps dashboards clean. Operators can use the presence/absence of these metrics to confirm whether a connector is running in Share Group mode.

All metrics are registered under the existing `sink-task-metrics` group (same as `sinkTaskGroupName` in `ConnectMetricsRegistry`), tagged with `connector` and `task`.

This keeps them co-located with the existing `sink-record-read-total`, `sink-record-send-total`, etc. and avoids a separate metric namespace.

Sensor NameMetric NameTypeTraditional Consumer (group.protocol=consumer)Share Consumer (group.protocol=share)
sink-record-acquiresink-record-acquire-rateRatenot registeredRecords/sec acquired from the share group

sink-record-acquire-totalCumulativeSumnot registeredTotal records acquired from the share group
sink-record-acknowledgesink-record-acknowledge-rateRatenot registeredRecords/sec acknowledged (ACCEPT)

sink-record-acknowledge-totalCumulativeSumnot registeredTotal records acknowledged (ACCEPT)
sink-record-releasesink-record-release-rateRatenot registeredRecords/sec released (RELEASE) for re-delivery

sink-record-release-totalCumulativeSumnot registeredTotal records released for re-delivery
sink-record-rejectsink-record-reject-rateRatenot registeredRecords/sec rejected (REJECT) to DLQ

sink-record-reject-totalCumulativeSumnot registeredTotal records rejected to DLQ
acknowledge-timeacknowledge-time-maxMaxnot registeredMax time (ms) between poll() and acknowledge()

acknowledge-time-avgAvgnot registeredAvg time (ms) between poll() and acknowledge()
sink-record-redeliverysink-record-redelivery-totalCumulativeSumnot registeredTotal records with delivery count > 1

Conversely, the following existing `WorkerSinkTask` sensors have no Share Group equivalent and are not registered by `WorkerShareSinkTask`:

Existing SensorWhy not applicable to Share Groups
partition-countShare Groups don't assign partitions exclusively to tasks. All tasks consume from all subscribed partitions.
offset-seq-numberShare Groups don't use consumer offsets. Acknowledgments replace offset commits.
offset-commit-completionNo offset commits in Share Groups. Replaced by sink-record-acknowledge.
offset-commit-completion-skipNo offset commits to skip.


The existing sensors that are shared between both task types:

SensorBehavior
sink-record-readRegistered by both. Counts records polled (same semantics).
sink-record-sendRegistered by both. Counts records delivered to task.put().
sink-record-active-countRegistered by both. In Share Groups, this is the number of records currently ACQUIRED but not yet acknowledged.
put-batch-timeRegistered by both. Time spent in task.put().

4. Compatibility, Deprecation, and Migration Plan

...