{"id":36993133,"url":"https://github.com/kontoulis/rabbitmq-laravel","last_synced_at":"2026-01-13T23:45:18.843Z","repository":{"id":57008450,"uuid":"43605815","full_name":"kontoulis/rabbitmq-laravel","owner":"kontoulis","description":"A laravel package for RabitMQ management","archived":false,"fork":false,"pushed_at":"2018-02-03T11:47:39.000Z","size":49,"stargazers_count":15,"open_issues_count":0,"forks_count":5,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-20T00:53:31.729Z","etag":null,"topics":["laravel","php","rabbitmq"],"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/kontoulis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-10-03T16:34:28.000Z","updated_at":"2024-03-04T09:01:41.000Z","dependencies_parsed_at":"2022-08-21T12:30:14.515Z","dependency_job_id":null,"html_url":"https://github.com/kontoulis/rabbitmq-laravel","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/kontoulis/rabbitmq-laravel","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kontoulis%2Frabbitmq-laravel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kontoulis%2Frabbitmq-laravel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kontoulis%2Frabbitmq-laravel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kontoulis%2Frabbitmq-laravel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kontoulis","download_url":"https://codeload.github.com/kontoulis/rabbitmq-laravel/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kontoulis%2Frabbitmq-laravel/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28405292,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-13T21:51:37.118Z","status":"ssl_error","status_checked_at":"2026-01-13T21:45:14.585Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":["laravel","php","rabbitmq"],"created_at":"2026-01-13T23:45:18.696Z","updated_at":"2026-01-13T23:45:18.835Z","avatar_url":"https://github.com/kontoulis.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RabbitMQLaravel\n\n[![Latest Stable Version](https://poser.pugx.org/kontoulis/rabbitmq-laravel/v/stable)](https://packagist.org/packages/kontoulis/rabbitmq-laravel)\n[![Latest Unstable Version](https://poser.pugx.org/kontoulis/rabbit-manager/v/unstable)](https://packagist.org/packages/kontoulis/rabbitmq-laravel)\n[![License](https://poser.pugx.org/kontoulis/rabbit-manager/license)](https://packagist.org/packages/kontoulis/rabbitmq-laravel)\n## Installation\n\nVia Composer\n\n``` bash\n$ composer require kontoulis/rabbitmq-laravel\n```\n\nAdd the Service Provider to config/app.php\n\n``` php\nKontoulis\\RabbitMQLaravel\\RabbitMQLaravelServiceProvider::class,\n```\nAdd the RabbitMQ facade to config/app.php\n\n``` php\n'RabbitMQ' =\u003e Kontoulis\\RabbitMQLaravel\\Facades\\RabbitMQ::class,\n```\n\nPublish the configuration file and edit it if needed in config/rabbitmq-laravel.php\n``` bash\n$ php artisan vendor:publish\n```\n\n## Usage\n- Routing Key / Queue Name\n\nThe default routing key can be set in config file, or env(\"APP_NAME\").\"_queue\") will be used.\nAlso most methods take argument `$routingKey` which can override the default.\n```php\nRabbitMQ::setRoutingKey(\"myRoutingKey/queueName\");\n```\n\n- Exchange\n\nIf you don't set an exchange the default `''` exchange will be used.\nIf you set one, make sure the bindings are set in RabbitMQ system.\nif you are not familiar with exchanges you will probably do not need to set that.\n```php\nRabbitMQ::setExchange(\"myExchange\")'\n```\n\n\nYou can use the RabbitMQ facade to do anything as seen in https://github.com/php-amqplib/php-amqplib/blob/master/PhpAmqpLib/Channel/AMQPChannel.php . \nBasically, the RabbitMQ facade uses the Broker class which is an extension of AMQPChannel.\n\n- Publishing\n\n``` php\n// Single message\n \n$msg = [\n    \"key1\" =\u003e \"value1\", \n    \"key2\" =\u003e \"value2\"\n    ];         \nRabbitMQ::publishMesssage($msg);\n\n// OR\nRabbitMQ::publishMessage($msg, \"myRoutingKey\");\n\n// Batch publishing\n\n$messages = [\n    [ \"messsage_1_key1\" =\u003e \"value1\", \n      \"messsage_1_key2\" =\u003e \"value2\"\n    ],\n    [\n    \"messsage_2_key1\" =\u003e \"value1\", \n    \"messsage_2_key2\" =\u003e \"value2\"\n    ]\n];\nRabbitMQ::publishBatch($messages);\n// OR\nRabbitMQ::publishBatch($messages, \"myRoutingKey\");\n```\n\n- Consuming the Queue\n\nIn order to consume the queue, you could either use the AmqpChannel through the Facade,\nor use a better to manage approach with QueueHandlers.\nA QueueHandler should extend the Kontoulis\\RabbitMQLaravel\\Handlers\\Handler class and the built-in ListenToQueue method accepts an array of handlers to process the queue message.\nIf more than one handler exists in array, there are some Handler return values that will use the follow up QueueHandlers in cases of failure of the previous.\nThere is also a Kontoulis\\RabbitMQLaravel\\Handlers\\Handler\\DefaultHandler class as example and/or debug handler.\n\n```php\nnamespace Kontoulis\\RabbitMQLaravel\\Handlers;\n\nuse Kontoulis\\RabbitMQLaravel\\Message\\Message;\n\n/**\n * Class DefaultHandler\n * @package Kontoulis\\RabbitMQLaravel\\Handlers\n */\nclass DefaultHandler extends Handler{\n\n    /**\n     * Tries to process the incoming message.\n     * @param Message $msg\n     * @return int One of the possible return values defined as Handler\n     * constants.\n     */\n\n    public function process(Message $msg)\n    {\n        return $this-\u003ehandleSuccess($msg);\n\n    }\n\n    /**\n     * @param $msg\n     * @return int\n     */\n     protected function handleSuccess($msg)\n       {\n           var_dump($msg);\n           /**\n            * For more Handler return values see the parent class\n            */\n           return Handler::RV_SUCCEED_STOP;\n       }\n}\n```\n\nIn order to Listen to the Queue you have to pass an array of Handlers to the method\n```php\n$handlers = [\"\\\\App\\\\QueueHandlers\\\\MyHandler\"];\n\\RabbitMQ::listenToQueue($handlers);\n```\n\n## License\n\nThe MIT License (MIT). Please see [LICENCE.md](LICENSE.md) for more information.\n\n[ico-version]: https://img.shields.io/packagist/v/league/:package_name.svg?style=flat-square\n[ico-license]: https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square\n[ico-travis]: https://img.shields.io/travis/thephpleague/:package_name/master.svg?style=flat-square\n[ico-scrutinizer]: https://img.shields.io/scrutinizer/coverage/g/thephpleague/:package_name.svg?style=flat-square\n[ico-code-quality]: https://img.shields.io/scrutinizer/g/thephpleague/:package_name.svg?style=flat-square\n[ico-downloads]: https://img.shields.io/packagist/dt/league/:package_name.svg?style=flat-square\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkontoulis%2Frabbitmq-laravel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkontoulis%2Frabbitmq-laravel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkontoulis%2Frabbitmq-laravel/lists"}