Log robot commands to a topic
mdub opened this issue · 1 comments
mdub commented
Make it easy to append "robot commands" to a Kafka topic.
mdub commented
We created a development environment using docker-compose, running zookeeper
and kafka
locally, based on recipes from Confluent Inc.
auto/dev/setup
starts Kafka and creates a "robot-commands" topic (if it doesn't exist)
Then we created a little Ruby script, based on the ruby-kafka
gem. It validates commands and appends JSON-formatterd events to the topic, e.g.
$ ./auto/dev/robctl bobby control
... startup messages ...
> place 1 2 n
OK
> left
OK
We can watch them appearing with:
$ ./auto/dev/console scripts/watch
... startup messages ...
{"robot":"bobby","type":"place","event":{"x":1,"y":2,"direction":"n"}}
{"robot":"bobby","type":"rotate","event":{"direction":"left"}}