A demo to show how to use go and redpanda to build simple streaming API application using Echo Project.
go run server.go -brokers "$RPK_BROKERS"
rpk container start -n 1
NOTE:
Make a note of the RPK_BROKERS value and export as instructed
rpk topic create greetings --partitions=3 --replicas=1
Open a new terminal window
http --stream ':8080/?topic=greetings'
Since the application is set to use the same Consumer Group ID of format <topic>-echo-group
the consumer will not read the old messages when restarted. If you wish to read all from start run the following command,
http --stream ':8080/?topic=greetings&group=new'
This command will create a new consumer group on each request.
Open new terminal and run the following command to produce a new message to topic called greetings
,
http -v :8080/ topic=greetings key='1' value='Hello World!'
rpk container purge