Some convenient codes for working with kafka