{"id":18338753,"url":"https://github.com/tableflip/svs-amqplib","last_synced_at":"2025-04-09T20:35:47.824Z","repository":{"id":27638995,"uuid":"31123655","full_name":"tableflip/svs-amqplib","owner":"tableflip","description":"Utilities for working with the amqplib","archived":false,"fork":false,"pushed_at":"2015-02-21T13:30:37.000Z","size":144,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-02-15T12:46:44.758Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tableflip.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-02-21T11:35:50.000Z","updated_at":"2015-02-21T13:30:37.000Z","dependencies_parsed_at":"2022-09-03T03:24:01.747Z","dependency_job_id":null,"html_url":"https://github.com/tableflip/svs-amqplib","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tableflip%2Fsvs-amqplib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tableflip%2Fsvs-amqplib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tableflip%2Fsvs-amqplib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tableflip%2Fsvs-amqplib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tableflip","download_url":"https://codeload.github.com/tableflip/svs-amqplib/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248108347,"owners_count":21049116,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-05T20:15:05.007Z","updated_at":"2025-04-09T20:35:47.802Z","avatar_url":"https://github.com/tableflip.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# svs-amqplib\n\nUtilities for working with the [amqplib](https://www.npmjs.org/package/amqplib).\n\n## Example\n\n```js\nvar amqp = require('svs-amqplib')(config.url)\n\n/**\n * Create a new amqp connection and create a new channel\n * Subsequent calls to amqp.getChannel will return the same channel\n * (No new connection, unless connection is disconnected)\n */\namqp.getChannel(function (er, chan) {\n  // `chan` is a amqplib channel\n})\n\n/**\n * Create a new amqp connection and create a new _confirm_ channel\n * Subsequent calls to amqp.getConfirmChannel will return the same channel\n * (No new connection, unless connection is disconnected)\n */\namqp.getConfirmChannel(function (er, chan) {\n  // `chan` is an amqplib confirm channel\n})\n\n/**\n * Ensure a persistent connection to the amqp server\n * setupChannel called initially and on every disconnect\n * setupChannel should connect, setup and return a channel\n * customise timeout between re-connection retries\n */\namqp.reconnect('ID', setupChannel, {retryTimeout: 5000}, function (er, rc) {\n  console.log('Connected')\n  // In the future you can call rc.stop() to stop trying to reconnect\n})\n\nfunction setupChannel (cb) {\n  amqp.getChannel(function (er, chan) {\n    chan.assertQueue('queue', {}, function (er) {\n      chan.bindQueue('queue', 'exchange', 'route', {}, function (er) {\n        chan.consume('queue', onMessage, {}, function (er) {\n          cb(null, chan) // Ready!\n        })\n        function onMessage () { /* Eat some messages! */ }\n      })\n    })\n  })\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftableflip%2Fsvs-amqplib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftableflip%2Fsvs-amqplib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftableflip%2Fsvs-amqplib/lists"}