Hi,

I need to update a running topology on some user action.
So I have used following way in the topology : Killing the running topology
and again starting it

               NimbusClient client = NimbusClient.getConfiguredClient(conf);
>  try {
> ClusterSummary summary = client.getClient().getClusterInfo();
> for (TopologySummary s : summary.get_topologies()) {
>  if (s.get_name().equals(name)) {
>                                        client.killTopology(name);
> return true;
>  }
> }
> return false;
> }
>                StormSubmitter.submitTopology(topologyName,
> conf,builder.createTopology());



What happens here is : Topology is killed by the client, but when
Stormsubmitter submits the same topology, it gets exception for duplicate
topology name like below:

Exception in thread "main" java.lang.RuntimeException: Topology with name
> `test_topology` already exists on cluster
>         at
> backtype.storm.StormSubmitter.submitTopology(StormSubmitter.java:89)
>         at
> backtype.storm.StormSubmitter.submitTopology(StormSubmitter.java:58)
>         at com.cts.TestTopology.main(TestTopology.java:131)



What should I use to overcome this problem? or is there another way to
update the running topology?

Thanks,
Nishu Tayal

Reply via email to