Support Questions

Find answers, ask questions, and share your expertise
Announcements
Now Live: Explore expert insights and technical deep dives on the new Cloudera Community BlogsRead the Announcement

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.