public static KafkaInstance DeployNew(KafkaSettings settings, ILog log, bool started = true) { KafkaInstance kafkaInstance = null; try { kafkaInstance = KafkaDeployer.DeployNew(settings, log); if (started) { kafkaInstance.Start(); } return(kafkaInstance); } catch (Exception error) { log.Error(error, "Error in deploy. Will try to stop and cleanup."); kafkaInstance?.Dispose(); KafkaDeployer.Cleanup(settings); throw; } }
public void Dispose() { shellRunner.Stop(); KafkaDeployer.Cleanup(BaseDirectory); }