Skip to main content

python-kafka-consumer

If you are looking for more advanced demo of usage, please check README

Running

❗ Remember to setup transform-hub locally or use the platform's environment for the sequence deployment.

First, build kafka-consumer sample

# go to 'kafka-consumer' directory
cd python/kafka-consumer

# build
npm run build

If you run this sample on Self Hosted Hub, please start it with process adapter option:

DEVELOPMENT=1 sth --runtime-adapter=process

The second terminal

si seq deploy kafka-consumer/dist --args [{\"topic\":\"TOPIC\"},{\"server\":\"0.0.0.0:29092\"}]

Please note, that you need to deploy consumer sample with two args. One is topic, which is Kafka Topic name, from which you want to consume data. Second argument is address of your Kafka.

If you have data on specified topic, you should be able to see information on STH terminal. It should look similar to:

Topic name=TOPIC, Message=b'test message'

Check out the source on GitHub

Was it helpful?

Didn't find information needed?

Join our Scramjet Community on Discord, where you can get help from our engineers directly.