The Newque driver for node.js. Newque is a light-weight and powerful message broker.
Docker needs to be installed HTTPie needs to be installed
This will startup a docker container using the default configuration. On port 8000 there is an HTTP listener with a SQL backend.
docker pull newque/newque
docker run -p 8000:8000 -p 8001:8001 -p 8005:8005 -d -t newque/newque
Go to the newque docs: https://newque.github.io/ How to use HTTPie: https://httpie.org/doc
Using HTTPie let's write a series of messages to Newque:
http POST localhost:8000/v1/example atomic:=true messages:='["abc","def","ghi"]' --json
Using curl:
curl -H "Content-Type: application/json" -X POST "localhost:8000/v1/example" -d '{"atomic":"true","messages":["abc","def","ghi"]}'
Using HTTPie let's count how many messages are stored:
http GET localhost:8000/v1/example/count
Using curl
curl -i "localhost:8000/v1/example/count"
This will read one message (the first stored) using HTTPie:
http GET localhost:8000/v1/example 'newque-mode:one'
Using curl:
curl -i "localhost:8000/v1/example" -H "newque-mode:one"
To extract multiple messages at once:
http GET localhost:8000/v1/example 'newque-mode:many 2'
To extract after a specific ID:
http GET localhost:8000/v1/example 'newque-mode:after_id e28e1e86-f925-4922-9c62-30d57ebb7a62'
To check the configuration of the server. This will return the channels:
curl -i localhost:8001/channels
This will return the listeners setup on the server:
curl -i localhost:8001/listeners