PHPackages                             weldon/laravel-simple-rabbitmq - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Queues &amp; Workers](/categories/queues)
4. /
5. weldon/laravel-simple-rabbitmq

ActiveLibrary[Queues &amp; Workers](/categories/queues)

weldon/laravel-simple-rabbitmq
==============================

This package provides simple usage of rabbitmq.

v1.0.0(1y ago)0187MITPHPPHP ^8.1

Since Feb 21Pushed 1y agoCompare

[ Source](https://github.com/weldon-tech/laravel-simple-rabbitmq)[ Packagist](https://packagist.org/packages/weldon/laravel-simple-rabbitmq)[ Docs](https://github.com/weldon/laravel-simple-rabbitmq)[ RSS](/packages/weldon-laravel-simple-rabbitmq/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (7)Versions (2)Used By (0)

laravel-simple-rabbitmq
=======================

[](#laravel-simple-rabbitmq)

 [![](https://camo.githubusercontent.com/2266fcecf5053df42b48f7dc748802fd626386e6d9609564171fdb963088a40b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646570656e64656e63792d762f77656c646f6e2f6c61726176656c2d73696d706c652d7261626269746d712f706870)](https://camo.githubusercontent.com/2266fcecf5053df42b48f7dc748802fd626386e6d9609564171fdb963088a40b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646570656e64656e63792d762f77656c646f6e2f6c61726176656c2d73696d706c652d7261626269746d712f706870) [![](https://camo.githubusercontent.com/5f5a1589b4c39785d476fbb578b7c169ea62f3aec3b2ed4336c662522da19896/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f77656c646f6e2f6c61726176656c2d73696d706c652d7261626269746d712e737667)](https://camo.githubusercontent.com/5f5a1589b4c39785d476fbb578b7c169ea62f3aec3b2ed4336c662522da19896/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f77656c646f6e2f6c61726176656c2d73696d706c652d7261626269746d712e737667) [![](https://camo.githubusercontent.com/5f6982b41fac24ea2c5bf914007ae4485e932e3a9e32cf646d97ad6b6ee2506e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f77656c646f6e2f6c61726176656c2d73696d706c652d7261626269746d712e737667)](https://camo.githubusercontent.com/5f6982b41fac24ea2c5bf914007ae4485e932e3a9e32cf646d97ad6b6ee2506e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f77656c646f6e2f6c61726176656c2d73696d706c652d7261626269746d712e737667) [![](https://camo.githubusercontent.com/4d0b59e18219382ebde18d985ca101adfe744ee66122f3f6627af88e19290620/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f77656c646f6e2f6c61726176656c2d73696d706c652d7261626269746d71)](https://camo.githubusercontent.com/4d0b59e18219382ebde18d985ca101adfe744ee66122f3f6627af88e19290620/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f77656c646f6e2f6c61726176656c2d73696d706c652d7261626269746d71)

The package for simplified RabbitMQ usage, supporting multiple connections, easy publishing, and consumer mode.

Documentation
-------------

[](#documentation)

- [Русский (RU)](README.RU.md)
- [O'zbekcha (UZ)](README.UZ.md)

### Key Features

[](#key-features)

- **Multiple Connections**: Effortlessly manage multiple RabbitMQ connections within the same application.
- **Exchange supporting**: You can push messages to exchanges
- **Message Publishing**: Easily publish messages to queues and exchange with a fluent, chainable syntax.
- **Consumer Mode**: Enable consumers to receive and process messages from queues in real time.
- **Manage queues and exchanges in config file**: You can register queues and exchanges in `config/simple-mq.php` and define them in easy way which is `amqp:define-queues` command.

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require weldon/laravel-simple-rabbitmq
```

Next step you must publish config and action register files:

```
php artisan vendor:publish --provider="Weldon\SimpleRabbit\SimpleRabbitMQServiceProvider"
```

As a result of this command, you will have a configuration file `config/simple-mq.php` and a registry file `routes/amqp-handlers.php`.

The `config/simple-mq.php` config file contains RabbitMQ connections with credentials, queues, default connection and default queue.

The next stage is configure `.env` file.

```
SIMPLE_MQ_CONNECTION=
SIMPLE_MQ_QUEUE=

SIMPLE_MQ_HOST=
SIMPLE_MQ_PORT=
SIMPLE_MQ_USERNAME=
SIMPLE_MQ_PASSWORD=

```

Usage
-----

[](#usage)

The package can publish and consume messages

### Publishing

[](#publishing)

You can publish a message with default connection and default queue:

```
