{"_id":"sl-mq","_rev":"226-54eaeab06eebd939e5469b7bef2ee0ac","name":"sl-mq","dist-tags":{"latest":"0.0.3"},"versions":{"0.0.1":{"name":"sl-mq","version":"0.0.1","author":{"name":"Sam Roberts","email":"sam@strongloop.com"},"license":"BSD","_id":"sl-mq@0.0.1","maintainers":[{"name":"octet","email":"sam@strongloop.com"}],"dist":{"shasum":"f4cf7e0f1bf54c1393faabeaf0daab85c0db5a2d","tarball":"https://registry.npmjs.org/sl-mq/-/sl-mq-0.0.1.tgz","integrity":"sha512-x0bCyQM2dVa5Uic/7owQYy0yrjCJaxrZuUUbERZf6Suf5LomPi+4mFgZli7rR2Ew0CY2PassxG5GO3e5ffMReg==","signatures":[{"sig":"MEYCIQCC/QGuuDCJvDjXsb9XSr/y48tQrEZvc7790KY6W/RUBAIhAI2ZDFcBCB3MSpb0g3O3LLVWsSTegOfuqjxyB9EIl/BK","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"index.js","_from":".","engines":{"node":"*"},"scripts":{"lint":"./node_modules/.bin/jshint *.js test lib","test":"mocha --reporter spec"},"_npmUser":{"name":"octet","email":"sam@strongloop.com"},"deprecated":"renamed to strong-mq","repository":{"url":"https://github.com/strongloop/sl-mq.git","type":"git"},"_npmVersion":"1.2.17","description":"clustering of applications on top of message queues","directories":{},"dependencies":{"amqp":"~0.1.6","async":"~0.2.8","underscore":"~1.4.4"},"devDependencies":{"mocha":"~1.9.0","jshint":"~2.0.1","marked":"*"}},"0.0.2":{"name":"sl-mq","version":"0.0.2","author":{"name":"Sam Roberts","email":"sam@strongloop.com"},"license":"BSD","_id":"sl-mq@0.0.2","maintainers":[{"name":"octet","email":"sam@strongloop.com"},{"name":"strongloop","email":"callback@strongloop.com"}],"bugs":{"url":"https://github.com/strongloop/sl-mq/issues"},"dist":{"shasum":"20612c8da8ddde6ea1482c28242a99b8eba674ee","tarball":"https://registry.npmjs.org/sl-mq/-/sl-mq-0.0.2.tgz","integrity":"sha512-kj7GlA7fCY8qGKgr6rbWAGic8vlNZXKSCnFTsxvrUOacLeAEzZ69Y/FUkNdGKUCNOzJxuIazMSyQ2h+1NJpwQw==","signatures":[{"sig":"MEYCIQCHHGVgvvJGTz0O4zn0wi36mrOjGBjFUS+z6Ro0ahkZ5AIhAJt8Sn4fKrmIcKJ2tFYWfv71/6SOACZanF1d6SiPOFU7","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"index.js","_from":"sl-mq","engines":{"node":"*"},"scripts":{"lint":"./node_modules/.bin/jshint *.js test lib","test":"mocha --reporter spec"},"_npmUser":{"name":"strongloop","email":"callback@strongloop.com"},"deprecated":"renamed to strong-mq","repository":{"url":"https://github.com/strongloop/sl-mq.git","type":"git"},"_npmVersion":"1.2.21","description":"clustering of applications on top of message queues","directories":{},"dependencies":{"amqp":"~0.1.6","async":"~0.2.8","underscore":"~1.4.4"},"devDependencies":{"mocha":"~1.9.0","jshint":"~2.0.1","marked":"*"}},"0.0.3":{"name":"sl-mq","version":"0.0.3","author":{"name":"Sam Roberts","email":"sam@strongloop.com"},"license":"BSD","_id":"sl-mq@0.0.3","maintainers":[{"name":"octet","email":"sam@strongloop.com"},{"name":"strongloop","email":"callback@strongloop.com"},{"name":"faisal","email":"faisal@faisal.com"}],"dist":{"shasum":"48a693d72d4fb0ef7aae295f604d212fa7824074","tarball":"https://registry.npmjs.org/sl-mq/-/sl-mq-0.0.3.tgz","integrity":"sha512-anPGyC7GiI+WbwV0XMjry+gB0NJELe4bErwxFJX3+SQfhvPLMELbaNii3iQ5Dn/FhG7O7Jg7XNgtlbmgyiHRcA==","signatures":[{"sig":"MEYCIQC6vt2HayVYgUDTV7XoqiCVs+JXLu0NmRjh47iXZt6JHwIhANL6hYGB5MG7CSUe1mnyWZ7cvv9RNB5U+GumfX9xPAzb","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"index.js","_from":".","engines":{"node":"*"},"scripts":{"lint":"./node_modules/.bin/jshint *.js test lib","test":"mocha --reporter spec"},"_npmUser":{"name":"octet","email":"sam@strongloop.com"},"deprecated":"renamed to strong-mq","repository":{"url":"https://github.com/strongloop/sl-mq.git","type":"git"},"_npmVersion":"1.2.17","description":"clustering of applications on top of message queues","directories":{},"dependencies":{"amqp":"~0.1.6","async":"~0.2.8","underscore":"~1.4.4"},"devDependencies":{"mocha":"~1.9.0","jshint":"~2.0.1","marked":"*"}}},"time":{"created":"2013-05-19T03:48:23.014Z","modified":"2026-04-14T15:16:03.635Z","0.0.1":"2013-05-19T03:48:25.641Z","0.0.2":"2013-05-20T23:39:49.040Z","0.0.3":"2013-05-24T21:26:41.780Z"},"author":{"name":"Sam Roberts","email":"sam@strongloop.com"},"license":"BSD","repository":{"url":"https://github.com/strongloop/sl-mq.git","type":"git"},"description":"clustering of applications on top of message queues","maintainers":[],"readme":"# SL-MQ - clustering of applications on top of message queues\n\n[sl-mq](https://github.com/strongloop/sl-mq) is an abstraction layer\nover common message distribution patterns, and several different message queue\nimplementations, including cluster-native messaging.\n\nIt allows applications to be written against a single message queue style API, and then\ndeployed either singly, or as a cluster, with deploy-time configuration of the messaging\nprovider.  Providers include native node clustering, allowing no-dependency deployment\nduring test and development. Support for other providers is on-going, and 3rd parties will\nbe able to add pluggable support for new message queue platforms.\n\n\n## Message Patterns\n\n- work queue: published messages are delivered to a single subscriber, common when\n  distributing work items that should be processed by a single worker\n- topic: published messages are delivered to all subscribers, each message is associated\n  with a \"topic\", and subscribers can specify the topic patterns they want to receive\n- rpc: published messages are delivered to a single subscriber, and a associated response\n  is returned to the original publisher (TBD)\n\n\n## Installation\n\n    % npm test\n    % npm install sl-mq\n\n\n## Synopsis\n\nAn example of connecting to a server and listening on a work queue:\n\n```javascript\nvar connection = require('sl-mq')\n    .create('amqp://localhost')\n    .open();\n\nvar push = connection.createPushQueue('todo-items');\npush.publish({job: 'clean pool'});\n\nvar pull = connection.createPullQueue('todo-items');\npull.subscribe(function(msg) {\n    console.log('TODO:', msg);\n    connection.close();\n});\n```\n\n\n## Event: 'error'\n\nErrors may be emitted as events from either a connection or a queue.  The nature of the\nerrors emitted depends on the underlying provider.\n\n\n## Messages\n\nMessage objects can be either an `Object` or `Array`, transmitted as JSON, or a `String`\nor `Buffer`, transmitted as data.\n\n\n## Queues\n\nQueues are closed when they are empty and have no users. They might or might not\nbe persistent across restarts of the queue broker, depending on the provider.\n\n\n## Connections\n\n### slmq.create([options|url])\n\nReturns a connection object for a specific provider, configuration can\nbe created using a options object, or a url:\n\n* `options` {Object}\n* `url` {provider://...}\n\nIf `create()` is called with no arguments, the native provider will be used.\n\nSupported providers are:\n\n* `'amqp'`: RabbitMQ\n* `'native'`: Cluster-native messaging\n\nSupported options, other than `provider`, depend on the provider:\n\n* `provider` {String} Mandatory name of provider, such as `'amqp'`\n* `host` {String} Name of host to connect to (if supported by provider)\n* `port` {String} Port to connect to (if supported by provider)\n* `...` As supported by the provider\n\nExample of creating an amqp connection, using an options object:\n\n    connection = clustemq.create({\n        provider: 'amqp',\n        host: 'localhost',\n        user: 'guest',\n    });\n\nExample of declaring amqp, using a URL:\n\n    connection = clusermq.create('amqp://guest@localhost');\n\n\n### connection.provider {String}\n\nProperty is set to the name of the provider.\n\n\n### connection.open()\n\nOpens a connection.\n\nExample:\n\n    connection.open().on('error', function () {\n      // ... handle error\n    });\n\n\n### connection.close([callback])\n\nCallsback when connection has been closed.\n\n\n## Work queues (push/pull)\n\n### connection.createPushQueue()\n\nReturn a queue for publishing work items.\n\n### push.publish(msg)\n\nPublish a msg to a push queue.\n\n* `msg` {Object} Message to publish to the queue\n\n### connection.createPullQueue()\n\nReturn a queue for subscribing to work items.\n\n### pull.subscribe([listener])\n\nListen for messages on a work queue.\n\n`listener` is optional, it will be added as a listener\nfor the `'message'` event if provided.\n\n### queue.close()\n\nClose the queue.\n\n### queue.name {String}\n\nName used to create queue.\n\n### queue.type {String}\n\nEither 'push', or 'pull'.\n\n### Event: 'message'\n\nEvent is emitted when a subcribed pull queue receives a message.\n\n* `msg` {Object} Message pulled off the queue\n\n\n## Topic queue (pub/sub)\n\nTopics are dot-separated alphanumeric (or `'_'`) words. Subscription patterns match\nleading words.\n\n### connection.createPubQueue()\n\nReturn a queue for publishing on topics.\n\n### pub.publish(msg, topic)\n\n* `msg` {Object} Message to publish onto the queue\n* `topic` {String} Topic of message, default is `''`\n\n\n### connection.createSubQueue()\n\nReturn a queue for subscribing to topics.\n\n### sub.subscribe(pattern[, listener])\n\nListen for messages matching pattern on a topic queue.\n\n* `pattern` {String} Pattern of message, may contain wildcards, default is `''`\n\n`listener` is optional, it will be added as a listener for the `'message'` event if\nprovided. Add your listener to the `'message'` event directly when subscribing multiple\ntimes, or all your listeners will be called for all messages.\n\nExample of subscribing to multiple patterns:\n\n    sub.subscribe('that.*')\n      .subscribe('this.*')\n      .on('message', function (msg) { ... });\n\nExample of subscribing to a single pattern, and providing a listener:\n\n    sub.subscribe('other.*', function (msg) { ... });\n\n### queue.close()\n\nClose the queue.\n\n### queue.name {String}\n\nName used to create queue.\n\n### queue.type {String}\n\nEither 'pub', or 'sub'.\n\n### Event: 'message'\n\nEvent is emitted when a subcribed pull queue receives a message.\n\n* `msg` {Object} Message pulled off the queue\n\n\n## Provider: NATIVE\n\nThe NativeConnection uses the built-in\n[cluster](http://nodejs.org/docs/latest/api/cluster.html) module to facilitate the\nSL-MQ API.  It's designed to be the first adapter people use in early development,\nbefore they get whatever system they will use for deployment up and running.\n\nIt has no options.\n\nThe URL format is:\n\n    native:[//]\n\n## Provider: AMQP\n\nSupport for RabbitMQ using the AMQP protocol. This provider is based\non the [node-amqp](https://npmjs.org/package/node-amqp) module, see\nits documentation for more information.\n\nThe options (except for `.provider`) or url is passed directly to node-amqp, supported\noptions are:\n\n* `host` {String} Hostname to connect to, defaults to `'localhost'`\n* `port` {String} Port to connect to, defaults to `5672`\n* `login` {String} Username to authenticate as, defaults to `'guest'`\n* `password` {String} Password to authenticate as, defaults to `'guest'`\n* `vhost` {String} Vhost, defaults to `'/'`\n\nThe URL format for specifying the options above is:\n\n    amqp://[login][:password][@]host[:port][/vhost]\n\nNote that the `host` is mandatory when using a URL.\n\nNote that node-amqp supports RabbitMQ 3.0.4, or higher. In particular, it will *not* work\nwith RabbitMQ 1.8.1 that is packaged with Debian 6, see the\n[upgrade instructions](http://www.rabbitmq.com/install-debian.html).\n\n\n## Future work\n\nFuture work may include support for the following, as needed, and if\ncommon mechanisms exist among the various queue providers.\n\n- Acknowledgement of msg processing, particularly for work queues, so\n  \"exactly once\" message handling can be guaranteed. The current API\n  is strictly \"one or less\", if a consumer fails to process a message\n  that has been delivered to it, it will never be processed.\n- Flow control, so consumers aren't overwhelmed by msgs, and can\n  provide back pressure on the queue when under load.\n- Persistence, whether queues persist beyond the existence of any\n  users or undelivered messages.\n","readmeFilename":"README.md","users":{"sharper":true,"freebird":true,"scottkay":true}}