# Kafka Datagen Connector
- Datagen connector based on config provieded will ingest mockdata into Kafka
- It uses Avro Random Generator(ARG) to generate mock data

## Requirements
- ARG schema file(look for label_participant_dparmar.avro in repo) which will contains mockdata schema to be ingested
- Connector config file(look for datagen.config in repo) which will register datagen connector

## Run Setup
Start sink connector with given below command. Find more info here [kafka-connect-datagen](https://github.com/confluentinc/kafka-connect-datagen/blob/master/README.md#run-connector-in-docker-compose "kafka-connect-datagen")

`$ cd datagen` \
`$ docker-compose up`

## Connector Config
### How to register kafka datagen connector
- You will find given below curl request in docker-compose.yml file which is commented
- Once connector is up & running use curl request given below to register datagen connector
- Look for  `"kafka.topic": "label_participant_dparmar",` in datagen.config & replace label_participant_dparmar with topic name you want to ingest to.
- For more info on config checkout [kafka-connect-datagen-specific-parameters](https://github.com/confluentinc/kafka-connect-datagen/blob/master/README.md#kafka-connect-datagen-specific-parameters "kafka-connect-datagen-specific-parameters")

```
curl -X POST -H "Content-Type: application/json" --data @datagen.config http://localhost:38083/connectors
```

### How to update kafka datagen connector config
- Update datagen.config as per your need
- Use curl command as given below to update config

```
curl -X PUT -H "Content-Type: application/json" --data @datagen.config http://localhost:38083/connectors
```

### How to delete kafka datagen connector
- Use curl command as given below to update sink connector

```
curl -X DELETE http://localhost:38083/connectors/datagen-label-participant
```
