Versions Compared

Key

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

...

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:

KeyValue
target-state-{connector} 


Code Block
languagejs
title"Naive" STOPPED record value
{"state": "STOPPED"}


We can "fool" older workers into treating STOPPED  requests as PAUSE  requests by emitting records with this format:

KeyValue
target-state-{connector} 


Code Block
languagejs
title"Clever" STOPPED record value
{
	"state": "PAUSED",
	"state.v2": "STOPPED"
}


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.