Streaming Data to Kafka
Storm provides a Kafka Bolt for both the core-storm and Trident APIs that publish data to Kafka topics.
Use the following procedure to add a Storm component to your topology that writes data to a Kafka cluster:
- Instantiate a Kafka Bolt.
- Configure the Kafka Bolt with a Tuple-to-Message mapper.
- Configure the Kafka Bolt with a Kafka Topic Selector.
- Configure the Kafka Bolt with Kafka Producer properties.
The following code samples illustrate the construction of a simple Kafka bolt.