Add new destroy()/onDelete() method to the Connect API
On the initial iteration, Initially we thought about adding a new destroy() method was added to the Connector class. This method was called during the The idea was to call this method on WorkerConnector#doShutdown() execution, and the idea was to call it right after the connector.stop(). method was was delete
is executed. This however presented some questions around the execution guarantees, for example, what the behavior would be when the Connector#stop() method never returned, or the method throws an exception. To make things simpler, an overloaded Connector#stop(boolean isDeleted) was introduced instead, so the expected behavior remains the same as with the current implementation. That is, the method is guaranteed to be called if the connector stops within CONNECTOR_GRACEFUL_SHUTDOWN_TIMEOUT_MS (default: 5 secs)
Delete provisioned resources out-of-band
In theoryy, users can monitor Kakfa Connect configuration topics to determine if/when a connector has been deleted. Reacting to this event outside of the connector's context is probably not very useful, as there might not be enough contextual information to perform any meaningful action. It is also better to keep these concerns encapsulated within the connector framework itself.