August 2017
Beginner to intermediate
278 pages
6h 40m
English
A producer application is designed to be 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 topic before running your producer application. You can change the topic name in the streaming.properties file mentioned before:
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 java.io.BufferedReader; ...
Read now
Unlock full access