In this Apache Pinot Recipe, we’ll learn how to ingest data from Apache Pulsar.
git clone git@github.com:startreedata/pinot-recipes.git cd pinot-recipes/recipes/ingest-json-files
make recipe
import pulsar import json import time import random import uuid client = pulsar.Client('pulsar://localhost:6650') producer = client.create_producer('events') message = { "ts": int(time.time() * 1000.0), "uuid": str(uuid.uuid4()).replace("-", ""), "count": random.randint(0, 1000) } payload = json.dumps(message, ensure_ascii=False).encode('utf-8') producer.send(payload) client.close()
make clean
docker system prune
Was this page helpful?