public class KafkaBolt<K,V> extends BaseTickTupleAwareRichBolt
Bolt implementation that can send Tuple data to Kafka
It expects the producer configuration and topic in storm config under ‘kafka.broker.properties’ and ‘topic’ respectively. This bolt uses 0.8.2 Kafka Producer API. It works for sending tuples to older Kafka version (0.8.1).| Constructor and Description |
|---|
KafkaBolt() |
| Modifier and Type | Method and Description |
|---|---|
void |
cleanup() |
void |
declareOutputFields(OutputFieldsDeclarer declarer) |
void |
prepare(Map stormConf,
TopologyContext context,
OutputCollector collector) |
protected void |
process(Tuple input) |
void |
setAsync(boolean async) |
void |
setFireAndForget(boolean fireAndForget) |
KafkaBolt<K,V> |
withProducerProperties(Properties producerProperties) |
KafkaBolt<K,V> |
withTopicSelector(KafkaTopicSelector selector) |
KafkaBolt<K,V> |
withTupleToKafkaMapper(TupleToKafkaMapper<K,V> mapper) |
execute, onTickTuplegetComponentConfigurationclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetComponentConfigurationpublic static final String TOPIC
public KafkaBolt<K,V> withTopicSelector(KafkaTopicSelector selector)
public KafkaBolt<K,V> withProducerProperties(Properties producerProperties)
public void prepare(Map stormConf, TopologyContext context, OutputCollector collector)
protected void process(Tuple input)
process in class BaseTickTupleAwareRichBoltpublic void declareOutputFields(OutputFieldsDeclarer declarer)
public void cleanup()
cleanup in interface IBoltcleanup in class BaseRichBoltpublic void setFireAndForget(boolean fireAndForget)
public void setAsync(boolean async)
Copyright © 2018 The Apache Software Foundation. All Rights Reserved.