PHPackages                             0mithun/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. 0mithun/laravel-simple-rabbitmq

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

0mithun/laravel-simple-rabbitmq
===============================

This package provides simple usage of rabbitmq.

2.0(8mo ago)0189MITPHPPHP ^8.1

Since Jun 22Pushed 8mo agoCompare

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

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

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

[](#laravel-simple-rabbitmq)

 [![](https://camo.githubusercontent.com/2bcc8d9fe48887a955e8814d5e644383122f63a2a797e89d2389dc4568fd4d6e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646570656e64656e63792d762f306d697468756e2f6c61726176656c2d73696d706c652d7261626269746d712f706870)](https://camo.githubusercontent.com/2bcc8d9fe48887a955e8814d5e644383122f63a2a797e89d2389dc4568fd4d6e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646570656e64656e63792d762f306d697468756e2f6c61726176656c2d73696d706c652d7261626269746d712f706870) [![](https://camo.githubusercontent.com/18d710aeb285bf53f2302c6aa35d4557e6947a9a9955871eca702392c10fc6c2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f306d697468756e2f6c61726176656c2d73696d706c652d7261626269746d712e737667)](https://camo.githubusercontent.com/18d710aeb285bf53f2302c6aa35d4557e6947a9a9955871eca702392c10fc6c2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f306d697468756e2f6c61726176656c2d73696d706c652d7261626269746d712e737667) [![](https://camo.githubusercontent.com/c5b640b58737a49a4e3fe4178a722c1930966b3ec9c37963cc9d230aa9c47106/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f306d697468756e2f6c61726176656c2d73696d706c652d7261626269746d712e737667)](https://camo.githubusercontent.com/c5b640b58737a49a4e3fe4178a722c1930966b3ec9c37963cc9d230aa9c47106/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f306d697468756e2f6c61726176656c2d73696d706c652d7261626269746d712e737667) [![](https://camo.githubusercontent.com/bca92ffc936b8e856d1beeca8c45b4c5b9ac8b614bd515b5e3cb01034373e8e7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f306d697468756e2f6c61726176656c2d73696d706c652d7261626269746d71)](https://camo.githubusercontent.com/bca92ffc936b8e856d1beeca8c45b4c5b9ac8b614bd515b5e3cb01034373e8e7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f306d697468756e2f6c61726176656c2d73696d706c652d7261626269746d71)

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

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

[](#documentation)

### 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 0mithun/laravel-simple-rabbitmq
```

Next step you must publish config and action register files:

```
php artisan vendor:publish --provider="Mithun\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:

```
