So we tested two approaches,
- Use a kafka docker inside travis build
In this approach we configured a docker image up and run which has kafka and zookeepr. Since travis has good support for docker this is straight forward.
- Install kafka munally and start it before travis build run.
In here we used travis "before_install" step to download a kakfa binary from one of mirror sites, then unpack, and start kafka with custom properties file hosted inside test packages.
2nd approach was more suitable unless you have docker repository with your own docker image.