This readme provides step-by-step instructions on running Redpanda, a producer for generating sample data, and Dozer for ingesting the Redpanda data and querying it. By following these steps, you will have a local setup where you can produce and consume data using Redpanda and Dozer.
Before starting, ensure that you have the following installed:
- Docker
- Python 3.9 or above
- Dozer
-
Create a file named
docker-compose.yaml
with the contents present indocker-compose.yml
from the repo: -
Run the following command to start Redpanda:
docker-compose up -d
To enable schema validation for the transaction data, you need to register the schema with the Schema Registry.
Run the following command to register the transaction schema:
curl -X POST -H "Content-Type: application/vnd.schemaregistry.v1+json" --data '{"schema": "{\"type\":\"record\",\"name\":\"transaction\",\"namespace\":\"dozer.samples\",\"fields\":[{\"name\":\"id\",\"type\":\"int\"}, {\"name\":\"customer_id\",\"type\":\"int\"},{\"name\":\"amount\",\"type\":\"float\"},{\"name\":\"location\",\"type\":\"string\"},{\"name\":\"provider\",\"type\":\"string\"}]}"}' http://localhost:18081/subjects/transactions-value/versions
curl -X POST -H "Content-Type: application/vnd.schemaregistry.v1+json" --data '{"schema": "{\"type\":\"record\",\"name\":\"transactions\",\"namespace\":\"dozer.samples\",\"fields\":[{\"name\":\"id\",\"type\":\"int\"}]}"}' http://localhost:18081/subjects/transactions-key/versions
-
Create a Python script named
producer.py
with the code to generate sample data and publish it to Redpanda or useproducer.py
from the repo -
Run the following command to start the producer:
python producer.py
The producer will start generating sample data and publish it to Redpanda.
-
Create a configuration file named
dozer-config.yaml
with the necessary configuration for Dozer. You can use the samedozer-config.yaml
from this repo as well. -
Run the following command to start Dozer:
dozer -c dozer-config.yaml
Dozer will ingest the data from Redpanda and perform the specified operations based on the configuration.
-
Once Dozer is running, you can query the ingested data.
-
Use the specified endpoints or methods provided by Dozer to access the ingested data and perform queries as needed.