Skip to content

Latest commit

 

History

History
54 lines (43 loc) · 2.93 KB

File metadata and controls

54 lines (43 loc) · 2.93 KB

The scripts in this directory provide various examples of using Confluent's Python client for Kafka:

Additional examples for Confluent Cloud:

venv setup

It's usually a good idea to install Python dependencies in a virtual environment to avoid conflicts between projects.

To setup a venv with the latest release version of confluent-kafka and dependencies of all examples installed:

python3 -m venv venv_examples
source venv_examples/bin/activate
python3 -m pip install confluent_kafka
python3 -m pip  install -r requirements/requirements-examples.txt

To setup a venv that uses the current source tree version of confluent_kafka, you need to have a C compiler and librdkafka installed (from a package, or from source). Then:

python3 -m venv venv_examples
source venv_examples/bin/activate
python3 -m pip install .[examples]

When you're finished with the venv:

deactivate