-
Notifications
You must be signed in to change notification settings - Fork 0
Setup instructions
Following software is required:
This configuration assumes Mac OS and /bin
directory of the application contains pre-compiled binaries for Mac OS.
mkdir nsq-demo && cd nsq-demo
git clone https://github.com/mpmlj/nsq-demo.git .
docker-compose up -d
Wait until the cluster is loaded (5-10sec avg.)
You may want to run docker-compose in a non-daemon mode to have visibility into its load process, i.e. just
docker-compose up
./bin/consumer
http://127.0.0.1:4171/topics/events
Notice zero message stats. Later, you may need to refresh it manually as its UI has no auto-refresh. Also, to experiment with queue interruptions during the ingestion process, you may want to pause/un-pause the topic, etc.
./bin/producer --file=data/data.dump
Note: for a different dump file use --file argument.
Notice consumer working and outputting stats on incoming messages in its terminal window.
#####On load success
Consumer's terminal output should end with: "session COMPLETED waiting for input..."
Monitoring tool page for the events topic http://127.0.0.1:4171/topics/events should be showing: 6314 in all "Messages" columns and 0 in all "Depth" columns, meaning we have processed 6314 messages (record batches) and no messages remains to be processed.
Optional. At this point you may exist the consumer with "Ctrl-C".
./bin/server
Default port is 9999. To change the port use a --server_port
flag, ex.
./bin/server --server_port=8888
http://localhost:9999/
and follow links to respective JSON endpoints with task outputs. To change the output, use different values in "video_id" and "country" endpoint arguments.
Quit the API server by "Ctrl-C".
Run docker-compose stop
to stop the containers.
Run docker-compose rm
(and "Y" to confirm) to remove the containers.