0.0.2 • Published 4 years ago

messagecat v0.0.2

Weekly downloads
4
License
MIT
Repository
github
Last release
4 years ago

:cat2: messagecat

websocket enabled restful message queue for redis

feature

  • Stable fastify web server and node ws
  • Messages are stored in redis.
  • Supports multi consumers for one queue, checkpoints per each consumer.
  • Language or framework independent
  • Stored data will survive in X days (7 in default), and it is customizable.
  • Supports restful http request or websocket connection

requirements

  • redis>=5.0 or Amazon elastiCache

with docker

docker run --rm -it -p 8000:8000 \
    -e HOST=0.0.0.0 \
    -e PORT=4000 \
    -e REDIS_URL=redis://sample.redis \
    -e EXPIRE=1 \
    laberin/messagecat

terms

  • EXPIRE - Messages will be deleted after \ days.
  • consumerKey - The server distinguishes a sequence of clients by each consumerKey. In other words, if the consumerKeys are the same, the server assumes the same client.
  • topic - Topic is a unique name for the queue, which is automatically generated on request.

status

http://localhost:4000/v

usage with curl

# produce data to queue
curl -v -H 'content-type: application/json' 'localhost:4000/q/topic1' -d '{"data": "test1"}'
# consumer 1
curl -v -H 'content-type: application/json' "localhost:4000/q/topic1?consumerKey=1"
# consumer 1 (no data recieved)
curl -v -H 'content-type: application/json' "localhost:4000/q/topic1?consumerKey=1"
# consumer 2
curl -v -H 'content-type: application/json' "localhost:4000/q/topic1?consumerKey=2"
# consumer 2 (no data recieved)
curl -v -H 'content-type: application/json' "localhost:4000/q/topic1?consumerKey=2"
# reset consumer 2 sequence
curl -XDELETE -v -H 'content-type: application/json' 'localhost:4000/q/topic1?consumerKey=2'
# consumer 2
curl -v -H 'content-type: application/json' "localhost:4000/q/topic1?consumerKey=2"
# consumer 2 (no data recieved)
curl -v -H 'content-type: application/json' "localhost:4000/q/topic1?consumerKey=2"

TODO

  • monitoring screen
  • external tools integration