There is a well-maintained library called kafka-python
. Create a program that uses this. Then you will automatically want kafka in your unit tests.
How do you do it? In other words, it seems that various techniques have been devised in Java. http://qiita.com/kmizumar/items/60c60284501bda111065
But what about the python library? …… Speaking of which, kafka-python
itself started kafka with subprocess.
https://github.com/dpkp/kafka-python/blob/master/test/fixtures.py#L23
The binary distribution of kafka has an easy-to-configure startup file, but kafka-python
uses its own configuration file to launch it. It is to be able to set parameters such as the port to bind, and there seems to be nothing more than that.
If it's a very simple library, I wonder if I can test it with the configuration file of the binary distribution.
Recommended Posts