@Override public void deploy(TopologyContext context) throws Exception { TopologyActions topologyActions = context.getTopologyActions(); Topology topology = context.getTopology(); TopologyDag dag = topology.getTopologyDag(); TopologyLayout layout = CatalogToLayoutConverter.getTopologyLayout(topology, dag); if (dag == null) { throw new IllegalStateException("Topology dag not set up"); } try { context.setCurrentAction("Submitting topology to streaming engine"); String mavenArtifacts = context.getMavenArtifacts(); topologyActions.deploy(layout, mavenArtifacts, context, context.getAsUser()); context.setState(TOPOLOGY_STATE_DEPLOYED); context.setCurrentAction("Topology deployed"); } catch (Exception ex) { LOG.error("Error while trying to deploy the topology in the streaming engine", ex); LOG.error("Trying to kill any running instance of topology '{}'", context.getTopology().getName()); killTopologyIfRunning(context, layout); context.setState(TOPOLOGY_STATE_DEPLOYMENT_FAILED); context.setCurrentAction("Topology submission failed due to: " + ex); throw new IgnoreTransactionRollbackException(ex); } }