copy from https://github.com/Shopify/sarama, for read code and comment