August 2017
Beginner to intermediate
278 pages
6h 40m
English
Our producer application is designed like a real-time log producer, where the producer runs every three seconds and produces a new record with random IP addresses. You can add a few records in the IP_LOG.log file and then the producer will take care of producing millions of unique records from those three records.
We have also enabled auto creation of topics, so you need not create a topic before running your producer application. You can change the topic name in the streaming.properties file mentioned previously.
import com.packt.reader.PropertyReader;import org.apache.kafka.clients.producer.KafkaProducer;import org.apache.kafka.clients.producer.ProducerRecord;import org.apache.kafka.clients.producer.RecordMetadata;import ...
Read now
Unlock full access