...
Kafka Connect currently supports two "target states" for a connector: RUNNING
(the default), and PAUSED
. The target state for a connector can be controlled using the REST API, using the PUT /connectors/connector/resume
endpoint for the RUNNING
state and the PUT /connectors/connector/pausedpause
endpoint for the PAUSED
state.
...
Instead of publishing a "naive" record to the config topic with contents like this:
Key | Value | |||||||
---|---|---|---|---|---|---|---|---|
target-state-{connector} |
|
We can "fool" older workers into treating STOPPED
requests as PAUSE
requests by emitting records with this format:
Key | Value | |||||||
---|---|---|---|---|---|---|---|---|
target-state-{connector} |
|
Older workers will inspect the state
field of the record value, see that it is PAUSED
, and pause the parts of the connector that they are assigned.
...
Rejected because: This would be significantly harder to implement, and the benefits are negligible compared to the workaround of deleting the stopping the connector, resetting its offsets, and then recreating it.