use of org.openkilda.wfm.ctrl.RouteBolt in project open-kilda by telstra.
the class AbstractTopology method createCtrlBranch.
protected void createCtrlBranch(TopologyBuilder builder, List<CtrlBoltRef> targets) throws StreamNameCollisionException {
checkAndCreateTopic(config.getKafkaCtrlTopic());
KafkaSpout kafkaSpout;
kafkaSpout = createKafkaSpout(config.getKafkaCtrlTopic(), SPOUT_ID_CTRL);
builder.setSpout(SPOUT_ID_CTRL, kafkaSpout);
RouteBolt route = new RouteBolt(getTopologyName());
builder.setBolt(BOLT_ID_CTRL_ROUTE, route).shuffleGrouping(SPOUT_ID_CTRL);
KafkaBolt kafkaBolt = createKafkaBolt(config.getKafkaCtrlTopic());
BoltDeclarer outputSetup = builder.setBolt(BOLT_ID_CTRL_OUTPUT, kafkaBolt).shuffleGrouping(BOLT_ID_CTRL_ROUTE, route.STREAM_ID_ERROR);
for (CtrlBoltRef ref : targets) {
String boltId = ref.getBoltId();
ref.getDeclarer().allGrouping(BOLT_ID_CTRL_ROUTE, route.registerEndpoint(boltId));
outputSetup.shuffleGrouping(boltId, ref.getBolt().getCtrlStreamId());
}
}
Aggregations