Thanks for your email thread replay, this switch same not the best.I have changed another way to solve this problom,can you help me review the pr: https://github.com/apache/kafka/pull/7706/files
the email thread url is https://lists.apache.org/thread.html/r636f607c8937bc557b476346faa25f10a26cf5bee7fd934a447e1708%40%3Cdev.kafka.apache.org%3E