Thread.sleep(timeToSleep); topicConsumer.close();
topicConsumer.receive(3000);
         public void run()         {            try            {               // this is needed to make sure the main thread has enough time to block               Thread.sleep(timeToSleep);               topicConsumer.close();            }            catch(Exception e)            {               log.error(e);            }            finally            {               latch.release();            }         }