public class KafkaBolt<K,V> extends BaseRichBolt
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 |
execute(Tuple input) |
void |
prepare(Map stormConf,
TopologyContext context,
OutputCollector collector) |
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) |
getComponentConfiguration
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getComponentConfiguration
public 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)
public void execute(Tuple input)
public void declareOutputFields(OutputFieldsDeclarer declarer)
public void cleanup()
cleanup
in interface IBolt
cleanup
in class BaseRichBolt
public void setFireAndForget(boolean fireAndForget)
public void setAsync(boolean async)
Copyright © 2016 The Apache Software Foundation. All Rights Reserved.