Added additional Thread.sleep() call after initializing the consumer and producer.