Search in sources :

Example 1 with EventHubBolt

use of org.apache.storm.eventhubs.bolt.EventHubBolt in project storm by apache.

the class EventHubLoop method buildTopology.

@Override
protected StormTopology buildTopology(EventHubSpout eventHubSpout) {
    TopologyBuilder topologyBuilder = new TopologyBuilder();
    topologyBuilder.setSpout("EventHubsSpout", eventHubSpout, spoutConfig.getPartitionCount()).setNumTasks(spoutConfig.getPartitionCount());
    EventHubBoltConfig boltConfig = new EventHubBoltConfig(spoutConfig.getConnectionString(), spoutConfig.getEntityPath(), true);
    EventHubBolt eventHubBolt = new EventHubBolt(boltConfig);
    int boltTasks = spoutConfig.getPartitionCount();
    topologyBuilder.setBolt("EventHubsBolt", eventHubBolt, boltTasks).localOrShuffleGrouping("EventHubsSpout").setNumTasks(boltTasks);
    return topologyBuilder.createTopology();
}
Also used : EventHubBolt(org.apache.storm.eventhubs.bolt.EventHubBolt) TopologyBuilder(org.apache.storm.topology.TopologyBuilder) EventHubBoltConfig(org.apache.storm.eventhubs.bolt.EventHubBoltConfig)

Aggregations

EventHubBolt (org.apache.storm.eventhubs.bolt.EventHubBolt)1 EventHubBoltConfig (org.apache.storm.eventhubs.bolt.EventHubBoltConfig)1 TopologyBuilder (org.apache.storm.topology.TopologyBuilder)1