Building the data simulator

Before generating the real-time data of the vehicle, we need to have the starting point of the vehicle. Following is the code snippet to the generate data:

package com.book.simulator;import java.util.HashMap;import java.util.Map;import java.util.Properties;import java.util.Random;import org.apache.kafka.clients.producer.KafkaProducer;import org.apache.kafka.clients.producer.ProducerRecord;import org.apache.kafka.common.serialization.StringSerializer;import com.book.domain.Location;import com.fasterxml.jackson.core.JsonProcessingException;import com.fasterxml.jackson.databind.ObjectMapper;/*** This class is used to generate vehicle start point for number of vehicle* specified by user.** @author SGupta**/public class ...

Get Practical Real-time Data Processing and Analytics now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.