Kafka

KafkaSpout API

KafkaSpout API

 

KafkaSpout is a spout implementation that integrates with Storm and can read from Kafka clusters and then emit those messages as tuples within the Storm ecosystem. Here’s a sample code to create a simple KafkaSpout -

 

// ZooKeeper connection string

BrokerHosts hosts = new ZkHosts(zkConnString);

 

//Creating SpoutConfig Object

SpoutConfig spoutConfig = new SpoutConfig(hosts, 

   topicName, "/" + topicName UUID.randomUUID().toString());

 

//convert the ByteBuffer to String.

spoutConfig.scheme = new SchemeAsMultiScheme(new StringScheme());

 

//Assign SpoutConfig to KafkaSpout.

KafkaSpout kafkaSpout = new KafkaSpout(spoutConfig);

 

PyTest Basics
2 hrs
Beginner
1.1K+ Learners
4.22 (46)
Python MySQL
1 hrs
Beginner
5.5K+ Learners
4.56 (167)
Python Automation Project
2 hrs
Beginner
3.8K+ Learners
4.48 (97)
Python For Android
2 hrs
Beginner
2.3K+ Learners
4.46 (41)
Kivy Projects
2 hrs
Beginner
1.2K+ Learners
4.61 (23)
File Manipulation in Python
1 hrs
Beginner
894 Learners
4.13 (23)
Regex in Python
1 hrs
Beginner
1.4K+ Learners
4.26 (54)
Heap Sort Program in C
1 hrs
Beginner
773 Learners
4.6 (20)
Python Jobs
2 hrs
Beginner
1.8K+ Learners
4.39 (31)
Merge Sort Algorithm Using Java
1 hrs
Beginner
588 Learners
4.7 (10)