{"id":19149359,"url":"https://github.com/restuwahyu13/node-rabbitmq-rpc","last_synced_at":"2026-05-08T16:47:05.655Z","repository":{"id":114456797,"uuid":"606400611","full_name":"restuwahyu13/node-rabbitmq-rpc","owner":"restuwahyu13","description":"Example rabbitmq rpc pattern using messaging pattern (Request \u0026 Reply)","archived":false,"fork":false,"pushed_at":"2023-02-26T05:13:07.000Z","size":18041,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-22T20:32:05.897Z","etag":null,"topics":["message-broker","node","rabbitmq","rpc"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/restuwahyu13.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2023-02-25T11:30:54.000Z","updated_at":"2024-10-27T07:06:53.000Z","dependencies_parsed_at":"2023-06-08T00:30:23.061Z","dependency_job_id":null,"html_url":"https://github.com/restuwahyu13/node-rabbitmq-rpc","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/restuwahyu13/node-rabbitmq-rpc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/restuwahyu13%2Fnode-rabbitmq-rpc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/restuwahyu13%2Fnode-rabbitmq-rpc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/restuwahyu13%2Fnode-rabbitmq-rpc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/restuwahyu13%2Fnode-rabbitmq-rpc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/restuwahyu13","download_url":"https://codeload.github.com/restuwahyu13/node-rabbitmq-rpc/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/restuwahyu13%2Fnode-rabbitmq-rpc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32789360,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-08T08:22:46.396Z","status":"ssl_error","status_checked_at":"2026-05-08T08:22:45.650Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["message-broker","node","rabbitmq","rpc"],"created_at":"2024-11-09T08:07:54.185Z","updated_at":"2026-05-08T16:47:05.609Z","avatar_url":"https://github.com/restuwahyu13.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RABBITMQ RPC (Request \u0026 Reply Pattern)\n\nCheck this tutorial about rpc queue using **rabbitmq** [here](https://www.rabbitmq.com/tutorials/tutorial-six-python.html) and check this tutorial about messaging pattern request \u0026 reply [here](https://www.enterpriseintegrationpatterns.com/RequestReply.html), if you need tutorial about rabbitmq check my repo [here](https://github.com/restuwahyu13/node-rabbitmq), or if you need other example rpc pattern using go [here](https://github.com/restuwahyu13/golang-rabbitmq-rpc).\n\n## Server RPC\n\n```ts\nimport { faker } from '@faker-js/faker'\nimport { RabbitMQ, consumerOverwriteResponse } from './rabbitmq'\n\nconst requestData: Record\u003cstring, any\u003e = {\n  id: faker.datatype.uuid(),\n  name: faker.name.fullName(),\n  country: faker.address.country(),\n  city: faker.address.city(),\n  postcode: faker.address.zipCode()\n}\n\nconst replyTo: consumerOverwriteResponse = {\n  data: requestData\n}\n\nconst rabbitmq: InstanceType\u003ctypeof RabbitMQ\u003e = new RabbitMQ()\nrabbitmq.consumerRpc('account', replyTo)\n\nprocess.on('SIGINT', function () {\n  console.log(`Terminated process: ${process.pid} successfully`)\n  process.exit(0)\n})\n\nsetInterval(() =\u003e console.log('...........................'), 3000)\n```\n\n## Client RPC\n\n```ts\nimport { faker } from '@faker-js/faker'\nimport { RabbitMQ, rpcResponse } from './rabbitmq'\n\nconst requestData: Record\u003cstring, any\u003e = {\n  id: faker.datatype.uuid(),\n  name: faker.name.fullName(),\n  country: faker.address.country(),\n  city: faker.address.city(),\n  postcode: faker.address.zipCode()\n}\n\nconst rabbitmq: InstanceType\u003ctypeof RabbitMQ\u003e = new RabbitMQ()\n\nrabbitmq.publishRpc('account', requestData).then((value: rpcResponse) =\u003e {\n  console.log(JSON.parse(value.data))\n})\n```\n\n## Noted Important!\n\nif queue name  is not deleted like this image below, after consumers consuming data from queue, because there is problem with your consumers.\n\n![](https://i.imgur.com/NpczUuG.png)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frestuwahyu13%2Fnode-rabbitmq-rpc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frestuwahyu13%2Fnode-rabbitmq-rpc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frestuwahyu13%2Fnode-rabbitmq-rpc/lists"}