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 ...