{"id":26539775,"url":"https://github.com/amqp-reply/amqp-reply","last_synced_at":"2026-03-08T19:36:50.691Z","repository":{"id":283125124,"uuid":"922472631","full_name":"amqp-reply/amqp-reply","owner":"amqp-reply","description":"Extension of Symfony's amqp-messenger that abstracts RabbitMQ's RPC (Remote Procedure Call) functionality","archived":false,"fork":false,"pushed_at":"2025-03-18T13:41:51.000Z","size":24,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-18T17:59:47.989Z","etag":null,"topics":["microservices","queue","rabbitmq","rpc","symfony"],"latest_commit_sha":null,"homepage":"","language":"PHP","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/amqp-reply.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":"2025-01-26T10:03:27.000Z","updated_at":"2025-03-17T19:32:13.000Z","dependencies_parsed_at":"2025-03-18T18:09:55.535Z","dependency_job_id":null,"html_url":"https://github.com/amqp-reply/amqp-reply","commit_stats":null,"previous_names":["amqp-reply/amqp-reply"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amqp-reply%2Famqp-reply","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amqp-reply%2Famqp-reply/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amqp-reply%2Famqp-reply/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amqp-reply%2Famqp-reply/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/amqp-reply","download_url":"https://codeload.github.com/amqp-reply/amqp-reply/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244885736,"owners_count":20526302,"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":["microservices","queue","rabbitmq","rpc","symfony"],"created_at":"2025-03-22T00:18:56.168Z","updated_at":"2026-03-08T19:36:50.686Z","avatar_url":"https://github.com/amqp-reply.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AMQP Reply Bundle\n\n[![codecov](https://codecov.io/gh/conejerock/ampq-bundle/branch/main/graph/badge.svg?token=NZ15C7YQ1X)](https://codecov.io/gh/conejerock/ampq-bundle)\n\nAMQP Reply Bundle is an extension of Symfony's `amqp-messenger` that abstracts RabbitMQ's RPC (Remote Procedure Call) functionality. It provides a simple and flexible way to send messages and wait for a response in Symfony microservices architecture.\n\n## Why Use AMQP Reply Bundle?\n\n- **Simple RPC Handling:** No need to manually implement RabbitMQ RPC.\n- **Seamless Symfony Integration:** Works directly with Symfony Messenger.\n- **Improved Microservices Communication:** Enables synchronous message processing while maintaining decoupled services.\n- **Reliable Response Management:** Built-in support for handling responses efficiently.\n\n## Installation\n\n```sh\ncomposer require amqp-reply/amqp-reply\n```\n\n## Configuration\n\nEnsure your Symfony Messenger transport configuration supports AMQP:\n\n```yaml\nframework:\n  messenger:\n    transports:\n      my_transport_sync:\n        dsn: 'amqp://guest:guest@rabbitmq:5672'\n        options:\n          exchange:\n            name: query_exchange\n            type: topic\n          queues:\n            query_queue: ~\n          reply: # Option to enable amqp-reply\n            timeout: 5\n            prefix: 'my_reply_'\n    routing:\n      'App\\Query\\MyQuery': my_transport_sync\n\n```\n\n## Usage\n\n### Sending a Request and Waiting for a Reply\n\n```php\ndeclare(strict_types=1);\n\nnamespace App;\n\nuse Symfony\\Component\\Messenger\\MessageBusInterface;\nuse App\\Query\\MyQuery;\nuse App\\Query\\MyQueryResponse;\n\nfinal class RpcClient\n{\n    public function __construct(private MessageBusInterface $bus) {}\n\n    public function __invoke(): string\n    {\n        $handledStamp = $this-\u003ebus-\u003edispatch(new MyQuery($id))-\u003elast(HandledStamp::class)\n        /** @var MyQueryResponse $response */\n        $response = $handledStamp-\u003egetResult();\n        return $response-\u003emessage;\n    }\n}\n```\n\n### Handling the Request in a Consumer\n\n```php\ndeclare(strict_types=1);\n\nnamespace App\\Query;\n\nuse Symfony\\Component\\Messenger\\Attribute\\AsMessageHandler;\n\nfinal class MyQuery\n{\n    public function __construct(public readonly string $id) {}\n}\n\n\nfinal class MyQueryResponse\n{\n    public function __construct(public readonly string $message) {}\n}\n\n\n#[AsMessageHandler]\nclass MyQueryHandler\n{\n\n    public function __invoke(MyQuery $query): MyQueryResponse\n    {\n        $message = 'Hello, ' . $query-\u003eid;\n        return new MyQueryResponse($message);\n    }\n}\n```\n\n### Consuming requests\n\n```sh\nphp bin/console messenger:consume my_transport_sync\n```\n\n## License\n\nThis library is licensed under the [MIT License](LICENSE).\n\n## Author\n\nDeveloped by [Juanjo Conejero](https://juanjoconejero.com).\n\n## Contribute\n\nContributions are welcome! Feel free to open issues and pull requests to improve this library.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famqp-reply%2Famqp-reply","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Famqp-reply%2Famqp-reply","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famqp-reply%2Famqp-reply/lists"}