2.1.0 • Published 6 years ago

meghduta v2.1.0

Weekly downloads
2
License
Apache License 2....
Repository
github
Last release
6 years ago

MeghdutaJS

Meghduta is distributed in memory messaging service written in NodeJS. Meghduta literally means Cloud Messenger and we strive to be so. :)

Features

  • Unlimited number of Queues (limited only by RAM memory)
  • Unlimited number of Topics (limited only by RAM memory)
  • Auto create Queue or Topic if not exists already
  • Simple HTTP API for Queue operations (PUSH, PULL) and Topic operation (PUB)
  • Websocket API for Topic operations (PUB, SUB)
  • HA cluster - Shared
  • HA cluster - Replicated
  • Auto SSL

Install

>> npm install -g meghduta

see examples directory

Usage - Library package

see examples/start.js

Usage - STANDALONE Mode

>> meghduta

Is equivalent to

>> meghduta --httpPort 6600 --webSocketPort 6610

Usage - SHARED Mode

one.example.com >> meghduta-shared --httpPort 6600 --webSocketPort 6610 --servers http://two.example.com:8080

two.example.com >> meghduta-shared --httpPort 8080 --webSocketPort 8081 --servers http://one.example.com:6600

Usage - SHARED Mode (more than 2 Servers)

>> meghduta-shared --servers http://localhost:8080,http://localhost:9090

>> meghduta-shared --httpPort 8080 --webSocketPort 8081 --servers http://localhost:6600,http://localhost:9090

>> meghduta-shared --httpPort 9090 --webSocketPort 9091 --servers http://localhost:8080,http://localhost:6600

API

TargetMethodPortURLRequestResponse
QueueHTTP POST6600/meghduta/queue/push{ "queue" : "MY_QUEUE", "message" : "First message to be queued" }'Message queued'
QueueHTTP POST6600/meghduta/queue/pull{ "queue" : "MY_QUEUE" }{ "message : "First message to be queued" }
TopicHTTP POST6600/meghduta/topic/publish{ "topic" : "MY_TOPIC", "message" : "First message to be published" }'Message published'
TopicWS Send6610/meghduta/topic'PUB MY_TOPIC Second message to be published'
TopicWS Send6610/meghduta/topic'SUB MY_TOPIC'

General Tips and Recommendation

  • Don't use it in cluster mode with PM2, use HA Shared or Replicated mode instead
  • HA cluster must be deployed behind load balancer
  • Use keepAlive=true in http client when consuming HTTP API for best performance
  • Use ZIP or LZ4 compression at client side for large message value
  • Only Queue contents are SHARED or REPLICATED in HA mode, Topic PUB-SUB functionality remains same

License

Apache 2.0

2.1.0

6 years ago

2.0.0

6 years ago

1.4.0

6 years ago

1.3.0

6 years ago

1.2.0

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.0

6 years ago