@Override public void run() { try { consumer.subscribe(topics); while (!closed.get()) { // Handle new records ConsumerRecord