{"id":36986745,"url":"https://github.com/ipunkt/laravel-rabbitmq","last_synced_at":"2026-01-13T23:05:02.311Z","repository":{"id":56993257,"uuid":"111424618","full_name":"ipunkt/laravel-rabbitmq","owner":"ipunkt","description":"[DEPRECATED] Interact with RabbitMQ with raw message data to interact with microservices of any language.","archived":true,"fork":false,"pushed_at":"2019-02-20T12:33:34.000Z","size":88,"stargazers_count":5,"open_issues_count":4,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-11-27T15:11:00.914Z","etag":null,"topics":["deprecated"],"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/ipunkt.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}},"created_at":"2017-11-20T15:01:49.000Z","updated_at":"2023-01-28T18:37:30.000Z","dependencies_parsed_at":"2022-08-21T10:40:39.191Z","dependency_job_id":null,"html_url":"https://github.com/ipunkt/laravel-rabbitmq","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/ipunkt/laravel-rabbitmq","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ipunkt%2Flaravel-rabbitmq","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ipunkt%2Flaravel-rabbitmq/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ipunkt%2Flaravel-rabbitmq/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ipunkt%2Flaravel-rabbitmq/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ipunkt","download_url":"https://codeload.github.com/ipunkt/laravel-rabbitmq/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ipunkt%2Flaravel-rabbitmq/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28405091,"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":["deprecated"],"created_at":"2026-01-13T23:05:01.511Z","updated_at":"2026-01-13T23:05:02.301Z","avatar_url":"https://github.com/ipunkt.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Deprecated\nThis package is abandoned. Please consider switching to enqueue with its laravel implementation:\nhttps://github.com/php-enqueue/enqueue-dev/blob/master/docs/laravel/quick_tour.md\n\n# RabbitMQ for Laravel\n\nWe provide a separate package for the use of [RabbitMQ](https://www.rabbitmq.com) because we want to use it for communication between microservices, written in any language. The existing packages are bound to laravel so we have the whole data - with class names and so on - within the message body. Our package sends only the raw data through RabbitMQ.\n\n[![Latest Stable Version](https://poser.pugx.org/ipunkt/laravel-rabbitmq/v/stable.svg)](https://packagist.org/packages/ipunkt/laravel-rabbitmq) [![Latest Unstable Version](https://poser.pugx.org/ipunkt/laravel-rabbitmq/v/unstable.svg)](https://packagist.org/packages/ipunkt/laravel-rabbitmq) [![License](https://poser.pugx.org/ipunkt/laravel-rabbitmq/license.svg)](https://packagist.org/packages/ipunkt/laravel-rabbitmq) [![Total Downloads](https://poser.pugx.org/ipunkt/laravel-rabbitmq/downloads.svg)](https://packagist.org/packages/ipunkt/laravel-rabbitmq)\n\nThis package provides the sending part as well as the listener part. The sending part sends synchronously to the message queue. The listener maps routing keys to an event listener configured.\n\n## Branch info\nThe master branch is currently for laravel 5.6+. Use the `5.4` branch for laravel \u003c= 5.5\nThis is necessary because laravel 5.6 changed the logging interfaces.\n\n## Quickstart\n\n```\ncomposer require ipunkt/laravel-rabbitmq\n```\n\nWe support package auto-discovery for laravel, so you are ready to use the package.\n\n\n## Installation\n\nAdd to your composer.json following lines\n\n\t\"require\": {\n\t\t\"ipunkt/laravel-rabbitmq\": \"*\"\n\t}\n\nYou can publish all provided files by typing `php artisan vendor:publish` and select to package provider (or one of the provided tags - but be careful, tags are global).\n\n## Configuration\n\nIn `config/laravel-rabbitmq.php` is the configuration for the usable queues on RabbitMQ. We do not use any of the values configured in the laravel-shipped `config/queues.php`.\n\n```php\n'YOUR-QUEUE-IDENTIFIER' =\u003e [\n\t'host' =\u003e 'YOUR-RABBITMQ-HOST',\n\t'port' =\u003e 5672,\n\t'user' =\u003e 'guest',\n\t'password' =\u003e 'guest',\n\t'name' =\u003e '',\n\t'durable' =\u003e false,\n\t'exchange' =\u003e [\n\t\t'exchange' =\u003e 'YOUR-EXCHANGE-NAME',\n\t\t'type' =\u003e 'YOUR-EXCHANGE-TYPE',\n\t\t'passive' =\u003e false,\n\t\t'durable' =\u003e false,\n\t\t'auto_delete' =\u003e false,\n\t\t'internal' =\u003e false,\n\t\t'nowait' =\u003e false,\n\t\t'arguments' =\u003e null,\n\t\t'ticket' =\u003e null,\n\t],\n\t'bindings' =\u003e [\n\t\t//  key =\u003e event name\n\t\t// ROUTING-KEY maps to an LARAVEL-EVENT-CLASS-NAME\n\t],\n],\n'logging' =\u003e [\n\t'enable' =\u003e false,\n\t/**\n\t * Set this to false if you do not wish to log Exceptions or Throwables from `rabbitmq:listen`\n\t */\n\t'event-errors' =\u003e true,\n\t'queue-identifier' =\u003e 'default',\n\t'extra-context' =\u003e [],\n],\n```\n\n## Usage\n\n### Publishing a Message\n\nWithin your controller oder console command you need our `RabbitMQ` class instance:\n\n```php\n$rabbitMQ = new \\Ipunkt\\LaravelRabbitMQ\\RabbitMQ();// or from DI container\n$rabbitMQ-\u003eonQueue('YOUR-QUEUE-IDENTIFIER') // Queue Identifier has to be configured within the laravel-rabbitmq.php\n\t-\u003edata(['users' =\u003e $users]) // anything, gets json_encoded\n\t-\u003epublish('ROUTING-KEY'); // publish to a routing key, the listener is subscribed to\n```\n\n### Subscribing for Messages\n\nFor subscribing we provide an artisan command:\n\n```bash\nphp artisan rabbitmq:listen YOUR-QUEUE-IDENTIFIER\n```\n\nWe suggest the message sender creates the exchange. If you do it the other way around the listener can create the exchange too. You need to add the command flag `--declare-exchange` to the `rabbitmq:listen` command.\n\nWithin the configuration `bindings` has routing keys configured with a 1:1 mapping to a laravel event (`php artisan make:event ...`). This event gets the message data as constructor parameter.\n\nThen you can have one or more listener (`php artisan make:listen ...`) - defined in your EventListener. And voila everything works fine.\n\nWe suggest running the `rabbitmq:listen` command with a [supervisor](https://laravel.com/docs/5.5/queues#supervisor-configuration) backed container like the [queue:work](https://laravel.com/docs/5.5/queues#running-the-queue-worker) command shipped with laravel.\n\n\n#### Receive routing keys in event data\nIf a binding with placeholder is used it can be necessary to parse the routing key.\n\nTo receive the routing key which triggered the Event to be thrown implement `Ipunkt\\LaravelRabbitMQ\\TakesRoutingKey` \nwith your event.\n\nTo receive the values of the placeholders in your event binding matching the routing key which triggered the Event to be\nthrown implement `Ipunkt\\LaravelRabbitMQ\\TakesRoutingMatches`\n\n#### Persistent messages\nSetting the `durable` for a queue will cause the queue to be created durable. This means it will continue to exist - and\n receive messages - when `rabbitmq:listen` is not running.\nTo take advantage of this fact `name` should also be set to a string identifying the microservice. This will cause the\nqueue to be named instead of anonymous so running `rabbitmq:listen` will actually reconnect to the queue and process all\nmessages received by it.\n\nSetting `durable` also enables consumer confirmation for messages.\nThis means a message is only deleted from the queue after it is confirmed. This is currently done by returning `true` or\n`false` from the EventHandler.\nReturning `true` acknowledges the message as done  \nReturning `false` acknowledges the message as not processed but does not concern this service so delete anyway\nReturning anything else including the default `null` or having an exception escalate outside the handler will not acknowledge\nthe message and have it return to the queue.\n\nNote the rabbitmq note on this mode of durability:\n\n---\n\n##### Note on message persistence\n\nMarking messages as persistent doesn't fully guarantee that a message won't be lost. Although it tells RabbitMQ to save the message to disk, there is still a short time window when RabbitMQ has accepted a message and hasn't saved it yet. Also, RabbitMQ doesn't do fsync(2) for every message -- it may be just saved to cache and not really written to the disk. The persistence guarantees aren't strong, but it's more than enough for our simple task queue. If you need a stronger guarantee then you can use publisher confirms.\n\n---\n\n### Logging\nIf logging is set to true then a MessageHandler is added to the laravel monolog instance which sends messages to the\ngiven exchange.\nIf `extra-context` is set then the content will be added to every messages context. Use case for this is to add\na `'service' =\u003e 'currentmicroservice'` info to all messages to identify which service the message is from.\nUnless `event-errors` is false Exceptions or Throwables caught in `rabbitmq:listen` are forwarded to the laravel logger.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fipunkt%2Flaravel-rabbitmq","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fipunkt%2Flaravel-rabbitmq","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fipunkt%2Flaravel-rabbitmq/lists"}