{"id":20297429,"url":"https://github.com/geggleto/slim-queue","last_synced_at":"2025-04-11T12:14:57.761Z","repository":{"id":54721467,"uuid":"102142447","full_name":"geggleto/slim-queue","owner":"geggleto","description":null,"archived":false,"fork":false,"pushed_at":"2021-03-09T08:08:08.000Z","size":35,"stargazers_count":9,"open_issues_count":3,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-25T08:38:26.539Z","etag":null,"topics":["php","rabbitmq","rabbitmq-queue"],"latest_commit_sha":null,"homepage":null,"language":"PHP","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/geggleto.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}},"created_at":"2017-09-01T18:35:54.000Z","updated_at":"2023-02-27T06:19:29.000Z","dependencies_parsed_at":"2022-08-14T00:50:13.202Z","dependency_job_id":null,"html_url":"https://github.com/geggleto/slim-queue","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geggleto%2Fslim-queue","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geggleto%2Fslim-queue/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geggleto%2Fslim-queue/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geggleto%2Fslim-queue/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/geggleto","download_url":"https://codeload.github.com/geggleto/slim-queue/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248399181,"owners_count":21097296,"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":["php","rabbitmq","rabbitmq-queue"],"created_at":"2024-11-14T15:47:34.002Z","updated_at":"2025-04-11T12:14:57.740Z","avatar_url":"https://github.com/geggleto.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SimpleQueue\n\nLibrary to provide developers easy to use Serialize/Hydration over AMQP protocol.\n\n### Dependencies\n\nYou will need to have Rabbit MQ running; you can do it via docker like this\n\n`docker run -d --hostname myrabbit --name myrabbit -p 15672:15672 -p 5672:5672 rabbitmq:3.8.11-management`\n\n### See it in action\n- Run the producer script - `php cli/producer.php`\n- Run the consumer script - `php cli/consumer.php`\n\n*If you want to see it in realtime*\n- Use the RabbitMQ Admin panel at `http://localhost:15672`\n    - Username `guest`\n    - Password `quest`\n    \n### Why dead-letters?\nIf your application nacks a message it will flow to the dead-letter queue for fault tolerance.\n\n\n# Usage / Design considerations\n\n### 1. Serialized objects\n\n```php\nclass MyObject extends \\SimpleQueue\\Messaging\\AbstractAmqpObject {\n    protected static string $routingKey = 'MyQueue.Cool';\n\n    public function getApplicationId(): ?string\n    {\n        return 'sf-internal-web';\n    }\n}\n```\n\nThe only requirement is that you MUST provide a routing key. The constructor of the concrete class accepts an array as a payload.\nYou may use this to serialize to scalar values any object / parameters you need to send to a background worker. An example would be an Event in your system.\n\n```php\nclass MyHandler implements \\SimpleQueue\\Messaging\\MessageHandler {\n\n    public function handle(\\SimpleQueue\\Messaging\\AmqpObjectInterface $object)\n    {\n        var_dump($object-\u003egetPayload());\n    }\n}\n```\nThe `$object-\u003egetPayload()` is whatever your system put into the constructor as long as it was filled with scalar values or could be jsonSerialized. \nIn your Handler you can do whatever you need to for your requirements. This could be running a background task, or executing an event.\n\n### 2. Dead-Letter Queues\n\nBy default the Config Factory will generate DLX/DLQ for you and bind them. This is recommended to allow for fault tolerance.\n\n### Support\n\nFind me on twitter @geggleto","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeggleto%2Fslim-queue","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgeggleto%2Fslim-queue","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeggleto%2Fslim-queue/lists"}