Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 22 lines (13 sloc) 1.06 KB
#!/bin/bash
HOST=localhost
FILE_ICAO=icao-to-aircraft.json
FILE_CALLSIGN=callsign-details.json
if [ ! -f ${FILE_ICAO} ] || [ ! -f ${FILE_CALLSIGN} ]; then
echo "You need to have a ${FILE_ICAO} and a ${FILE_CALLSIGN} file"
echo "There is a sample in files ${FILE_ICAO}.sample and a ${FILE_CALLSIGN}.sample"
exit 1
fi
cat ${FILE_ICAO} | kafka-avro-console-producer --broker-list ${HOST}:9092 --property schema.registry.url=http://${HOST}:8081 --topic icao-to-aircraft \
--property value.schema='{"type":"record","name":"i2a","fields":[{"name":"icao","type":"string"}, {"name":"manufacturer","type":"string"}, {"name":"aircraft","type":"string"}, {"name":"registration","type":"string"}]}'
cat ${FILE_CALLSIGN} | kafka-avro-console-producer --broker-list ${HOST}:9092 --property schema.registry.url=http://${HOST}:8081 --topic callsign-details \
--property value.schema='{"type":"record","name":"cd","fields":[{"name":"callsign","type":"string"}, {"name":"operatorname","type":"string"}, {"name":"fromairport","type":"string"}, {"name":"toairport","type":"string"}]}'