public void run()

in sample-kinesis-producer/src/main/java/com/optimize/downstream/samplekinesisproducer/IOTDeviceProducerToBlockingQueue.java [34:60]


    public void run() {
        long threadId = Thread.currentThread().getId();
        //System.out.println("Thread # " + threadId + " is doing this task");

        //while (!shutdown) {
        for(int i=0;i<numberOfMessages;i++)
        {
            try {
                IOTDevice iotDevice = generateIOTDeviceData();
                System.out.println("Inserting a message into blocking queue before sending to Kinesis Firehose and Message number is : " + i);
                inputQueue.put(iotDevice);
            } catch (Exception e) {
                e.printStackTrace();
            }
            if (i%100 == 0) // For every 100 messages sleep 500ms.
            {
                try {
                    System.out.println("Producer Thread # " + threadId + " is going to sleep mode for 500 ms.");
                    Thread.sleep(500);
                }
                catch (Exception e)
                {
                    e.printStackTrace();
                }
            }
        }
    }