Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to create multiple spouts in one topology? how?

I have two topics BACKUPDATA and LIVEDATA. what is the best solution for read both topics?? 1. Two different topologies? 2. One topology with two spouts? I tried with two different topology but storm not allocating slots to second topology.

like image 355
Irfan Avatar asked Sep 30 '22 16:09

Irfan


1 Answers

Yes, you can use multiple spouts in a topology.

builder.setSpout("kafka-spout1", new KafkaSpout(spoutConf1), 1);
builder.setSpout("kafka-spout2", new KafkaSpout(spoutConf2), 1);

Well, configuration depends on how you process the data.

If you create separate topology for both, so one topology failure issue won't affect another one, but It'll affect the running cost.

And in case of single topology with multiple spout, both will be affected with each-other failures. If you want to club the data from both topics at the same time, you should use multiple spouts.

like image 180
Nishu Tayal Avatar answered Nov 02 '22 03:11

Nishu Tayal