Search code examples
apache-kafkaapache-storm

Difference of KafkaBolt and BaseTickTupleAwareRichBolt


What is the difference between KafkaBolt and BaseTickTupleAwareRichBolt? What exactly do each one do? What are their pros and cons, and can you specify a quick example for each of them? Thanks!


Solution

  • They're not different, and one subsumes all pros and cons of the other

    KafkaBolt is a subclass of BaseTickTupleAwareRichBolt, with the later knowing nothing about Kafka. So, if you don't need to interact with Kafka outside of the Spout, you wouldn't use it. You could also just define a Kafka producer within your BaseTickTupleAwareRichBolt implementation

    What exactly do each one do?

    One defines a Bolt contract that can retrieve tuples from spouts. The other, a specific implementation that can be configured to interact with Kafka and send tuple information to a topic