When the console producer starts, it will log some text and hang, waiting for your input.
You can copy and paste all of the test data at once to see the results.
Start the console producer with this command in a terminal window of its own:
docker exec -i schema-registry /usr/bin/kafka-avro-console-producer --topic avro-movies --bootstrap-server broker:9092 --property value.schema="$(< src/main/avro/movie.avsc)"
When the producer starts up, copy and paste these JSON lines into the terminal:
{"movie_id":1,"title":"Lethal Weapon","release_year":1992}
{"movie_id":2,"title":"Die Hard","release_year":1988}
{"movie_id":3,"title":"Predator","release_year":1987}
{"movie_id":128,"title":"The Big Lebowski","release_year":1998}
{"movie_id":354,"title":"Tree of Life","release_year":2011}
{"movie_id":782,"title":"A Walk in the Clouds","release_year":1995}
Looking back in the consumer terminal, these are the results you should see if you paste in all the movies above:
{"movieId":"1","title":"Lethal Weapon","releaseYear":1992}
{"movieId":"2","title":"Die Hard","releaseYear":1988}
{"movieId":"3","title":"Predator","releaseYear":1987}
{"movieId":"128","title":"The Big Lebowski","releaseYear":1998}
{"movieId":"354","title":"Tree of Life","releaseYear":2011}
{"movieId":"782","title":"A Walk in the Clouds","releaseYear":1995}
You’ll notice that they look identical to the input that you produced.
The contents are in fact the same.
But since Avro isn’t a human-readable format, the kafka-protobuf-console-consumer
tool helpfully formatted the contents in something we can read, which happens to be JSON.
Congrats! You’ve converted formats across two topics.