Ktsllex
Kafka Topic and Schema creator
Usage
Add ktsllex to your deps list :
{:ktsllex, "~> 0.0.2"},
Run mix do deps.get, deps.compile
Now you have access to create_schemas and create_topics mix tasks, eg:
$ mix create_schemas --host=localhost:8081 --schema=schema_name --base=./path/to/schemas/json
$ mix create_topics --host=localhost:3030 --user=admin --password=admin --topic=topic_name--base
The path to the schema files is passed into mix create_schemas via --base=./path/to/schemas/json.
It expects to find two files there, one ending -key.json and one -value.json.
Example: If this command was used:
mix create_schemas --base=./schemas/usersThen there should be two flies in ./schemas:
./schemas-key.json./schemas-value.json
--schema
The -key and -value schemas get updated based on the schema parameter
Example: Given this myschema command :
mix create_schemas --schema=myschema
And if this is the schemas-key.json file :
{
"type": "record",
"name": "Key",
"namespace": "anything",
"connect.name": "anything.Key"
}Then it would be updated to
{
"type": "record",
"name": "Key",
"namespace": "myschema",
"connect.name": "myschema.Key"
}Development
mix deps.getmix test