Archives of Support Questions (Read Only)

This is an archived board for historical reference. Information and links may no longer be available or relevant
Announcements
This board is archived and read-only for historical reference. To ask a new question, please post a new topic on the appropriate active board.

Why the Thread.sleep(1000) in TruckEventsProducer.java after the producer.send()?

avatar
New Member

The TruckEventsProducer code implements a sleep() after each send():

producer.send(data);

Thread.sleep(1000);

Why is this necessary?

1 ACCEPTED SOLUTION

avatar
Master Mentor

it is for demo purposes, do not include this line in your production code. It's there to simulate new events every one second.

View solution in original post

1 REPLY 1

avatar
Master Mentor

it is for demo purposes, do not include this line in your production code. It's there to simulate new events every one second.