Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

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

avatar
New Contributor

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.