PHPackages                             lingxiao/swoft-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. lingxiao/swoft-rabbitmq

ActiveLibrary

lingxiao/swoft-rabbitmq
=======================

swoft-RabbitMq component for swoft framework

0217PHP

Since Feb 14Pushed 4y ago1 watchersCompare

[ Source](https://github.com/LingXiaoo/swoft-RabbitMq)[ Packagist](https://packagist.org/packages/lingxiao/swoft-rabbitmq)[ RSS](/packages/lingxiao-swoft-rabbitmq/feed)WikiDiscussions main Synced yesterday

READMEChangelogDependenciesVersions (1)Used By (0)

swoft-RabbitMq
==============

[](#swoft-rabbitmq)

###### 配置rabbitMq信息`bean.php`

[](#配置rabbitmq信息beanphp)

```
return [
    'config' => [
        'path' => __DIR__ . '/config',
    ],
    'rabbit'            => [
        'class'         => \Lingxiao\Swoft\RabbitMq\RabbitMq::class,
        'host'          => '127.0.0.1',
        'port'          => 5672,
        'user'          => '',
        'password'      => '',
        "queueLists"  => config("rabbit.queueLists"),
    ],
    'rabbit.pool'     => [
        'class'       => \Lingxiao\Swoft\RabbitMq\Pool::class,
        'rabbitMq'    => \bean('rabbit'),
        'minActive'   => 10,
        'maxActive'   => 20,
        'maxWait'     => 0,
        'maxWaitTime' => 0,
        'maxIdleTime' => 60,
    ],
];

```

###### 配置队列`config/rabbit.php`

[](#配置队列configrabbitphp)

```
return [
    //队列名称
    'queueLists' => [
        [
            'name' => 'test',
            'vhost' => '/vhost',
            'exchangeName' => 'test', //交换机名称
            'queueName' => 'test',//队列名称
            'routeKey' => '',
            'producerClass' => \Lingxiao\Swoft\RabbitMq\Producer\MqProducer::class,//生产者
            'consumerHandle' => \Lingxiao\Swoft\RabbitMq\Consumer\ConsumerHandle::class,//消费者处理类
            'autoAck' => false,//是否自动应答
            'exChange' => [
                'direct' => 'direct', //路由类型
                'passive' => true, //是否检测同名队列
                'durable' => false, //是否开启持久化
                'auto_delete' => false //关闭后是否删除
            ],
            'queue' => [
                'passive' => true, //是否检测同名队列
                'durable' => false, //是否开启持久化
                'exclusive' => false, //队列是否可以被其他队列访问
                'auto_delete' => false//关闭后是否删除
            ],
        ],
    ],

];

```

###### 使用方法

[](#使用方法)

```

消费者
/** @var Channel $channel */
$channel = BeanFactory::getBean(Channel::class);
$channel->setQueue('test');
/** @var ConsumerInterface $consumer */
$consumer = $channel->consumer();
$consumer->run();

生产者
/** @var Channel $channel */
$channel = BeanFactory::getBean(Channel::class);
$channel->setQueue('test');
/** @var ProducerInterface $producer */
$producer = $channel->producer();
$producer->setMessage('Hello World1');
$producer->setMessage('Hello World2');
$producer->push();

```

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity27

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/ee31c73444ad5b2b2a79d85b7c43c63dc71f175490e6ba3df7c44c92f8033e8d?d=identicon)[iAsuna](/maintainers/iAsuna)

---

Top Contributors

[![LingXiaoo](https://avatars.githubusercontent.com/u/28797584?v=4)](https://github.com/LingXiaoo "LingXiaoo (14 commits)")

### Embed Badge

![Health badge](/badges/lingxiao-swoft-rabbitmq/health.svg)

```
[![Health](https://phpackages.com/badges/lingxiao-swoft-rabbitmq/health.svg)](https://phpackages.com/packages/lingxiao-swoft-rabbitmq)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
