Lightweight stream-oriented messaging library for node.
Lightweight stream oriented full-stack messaging library.
pub/sub messaging patterns. Messaging pattern is high level concept of how messages should be handled on sending and receiving. It's
client/server & transport agnostic which means you can use all 4 types of messaging pattern no matter you are connected to a server or being connected from a client with any of the transports supported.
request will be sent to
one connected client/server and wait for
response (round-robin scheduler).
// example/rep.jsvar socketmq =var smq = socketmqsmqvar event = 'hello' // or you can call it topic or channel.smqsmq
// example/req.jsvar socketmq =var smq = socketmqsmqsmq
pub message will be distributed to all client/server connected and no response will be sent back. It's a fire and forget messaging pattern. Pub messages could be received by subscribing to the publishing topic.
// example/pub.jsvar socketmq =var smq = socketmqsmq
// example/sub.jsvar socketmq =var smq = socketmqsmqsmq
SocketMQ can tag the streams and send messages to streams with specific tags.
var socketmq =var tcpUri = 'tcp://127.0.0.1:6363'var smq = socketmqvar tlsUri = 'tls://127.0.0.1:46363'smq// Then send messages using `reqTag` of `pubTag`// `req` message only to server with `tcp` tagsmq// `pub` message only to server with `tls` tagsmq