{"id":15400305,"url":"https://github.com/rafaelgss/fastify-amqp","last_synced_at":"2025-04-15T21:34:28.224Z","repository":{"id":34948823,"uuid":"193133401","full_name":"RafaelGSS/fastify-amqp","owner":"RafaelGSS","description":"Plugin with interface to AMQP protocol - RabbitMQ","archived":false,"fork":false,"pushed_at":"2023-11-17T03:54:25.000Z","size":63,"stargazers_count":23,"open_issues_count":4,"forks_count":6,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-14T17:39:21.636Z","etag":null,"topics":["fastify","fastify-amqp","fastify-plugin","fastify-rabbitmq","hacktoberfest"],"latest_commit_sha":null,"homepage":"","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/RafaelGSS.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-06-21T17:00:35.000Z","updated_at":"2024-10-09T16:06:17.000Z","dependencies_parsed_at":"2024-06-19T15:20:13.169Z","dependency_job_id":"ebb6d4fb-3208-4601-8d11-6db69c9b0a4a","html_url":"https://github.com/RafaelGSS/fastify-amqp","commit_stats":{"total_commits":80,"total_committers":6,"mean_commits":"13.333333333333334","dds":0.5625,"last_synced_commit":"8aa405c45cb9390345bf46837bb57d4224ddcf4d"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RafaelGSS%2Ffastify-amqp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RafaelGSS%2Ffastify-amqp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RafaelGSS%2Ffastify-amqp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RafaelGSS%2Ffastify-amqp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RafaelGSS","download_url":"https://codeload.github.com/RafaelGSS/fastify-amqp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249157856,"owners_count":21222018,"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":["fastify","fastify-amqp","fastify-plugin","fastify-rabbitmq","hacktoberfest"],"created_at":"2024-10-01T15:53:28.853Z","updated_at":"2025-04-15T21:34:28.002Z","avatar_url":"https://github.com/RafaelGSS.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fastify-amqp\n[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](http://standardjs.com/)\n![CI workflow](https://github.com/RafaelGSS/fastify-amqp/workflows/CI%20workflow/badge.svg?branch=master)\n\nFastify AMQP connection plugin wrapper to amqplib, to use with RabbitMQ\n\n## Installation\n\nThis is a [Node.js](https://nodejs.org/) module available through the \n[npm registry](https://www.npmjs.com/). It can be installed using the \n[`npm`](https://docs.npmjs.com/getting-started/installing-npm-packages-locally)\nor \n[`yarn`](https://yarnpkg.com/en/)\ncommand line tools.\n\n```sh\nnpm install fastify-amqp --save\n```\n\n## Tests\n\n```sh\nnpm install\nnpm test\n```\n\n## Usage\n\n```js\nconst fastify = require('fastify')()\n\nfastify.register(require('fastify-amqp'), {\n  // the default value is amqp\n  protocol: 'amqp',\n  hostname: 'localhost',\n  // the default value is 5672\n  port: 5672,\n  // the default value is guest\n  username: 'guest',\n  // the default value is guest\n  password: 'guest'\n  // the default value is empty\n  vhost: ''\n})\n\nfastify.get('/', function (request, reply) {\n  const channel = this.amqp.channel\n\n  const queue = 'hello'\n  const msg = 'Hello world'\n\n  channel.assertQueue(queue, {\n    durable: false\n  })\n  \n  channel.sendToQueue(queue, Buffer.from(msg))\n  reply.send(' [x] Sent ' + msg)\n})\n\nfastify.listen(3000, err =\u003e {\n  if (err) throw err\n})\n```\n\n## Reference\n\nThis plugin is just a wrapper to [amqplib](https://github.com/squaremo/amqp.node).\n\nContains:\n\n- `amqp.connection` API to [here](http://www.squaremobius.net/amqp.node/channel_api.html#api_reference)\n- `amqp.channel` API to [here](http://www.squaremobius.net/amqp.node/channel_api.html#channel)\n\n## Dependencies\n\n- [amqplib](https://ghub.io/amqplib): An AMQP 0-9-1 (e.g., RabbitMQ) library and client.\n- [fastify-plugin](https://ghub.io/fastify-plugin): Plugin helper for Fastify\n\n## Dev Dependencies\n\n- [fastify](https://ghub.io/fastify): Fast and low overhead web framework, for Node.js\n- [pre-commit](https://ghub.io/pre-commit): Automatically install pre-commit hooks for your npm modules.\n- [standard](https://ghub.io/standard): JavaScript Standard Style\n- [tap](https://ghub.io/tap): A Test-Anything-Protocol library for JavaScript\n- [typescript](https://ghub.io/typescript): TypeScript is a language for application scale JavaScript development\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frafaelgss%2Ffastify-amqp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frafaelgss%2Ffastify-amqp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frafaelgss%2Ffastify-amqp/lists"}