binary-cube/carrot-mq
Composer 安装命令:
composer require binary-cube/carrot-mq
包简介
Carrot MQ :: Food for thought
README 文档
README
~ Enjoy your ☕ ~
Requirements
This package requires the following
- php ^7.2.5
- ext-bcmath
- ext-sockets
Installing
-
via "composer require":
composer require binary-cube/carrot-mq
-
via composer (manually):
If you're using Composer to manage dependencies, you can include the following in your
composer.jsonfile:{ "require": { "binary-cube/carrot-mq": "0.*" } }
Example of usage
<?php use BinaryCube\CarrotMQ\CarrotMQ; use BinaryCube\CarrotMQ\Driver\AmqpDriver; use BinaryCube\CarrotMQ\Processor\Processor; use BinaryCube\CarrotMQ\Extension\SignalExtension; include __DIR__ . '/vendor/autoload.php'; $config = [ 'connections' => [ 'default' => [ 'config' => [ 'extension' => AmqpDriver::EXTENSION_AMQP_LIB, 'host' => '127.0.0.1', 'port' => '5672', 'username' => 'guest', 'password' => 'guest', 'vhost' => '/', 'persisted' => false, ], ], ], 'topics' => [ 'topic-id-1' => [ 'name' => 't1', 'connection' => 'default', ], ], 'queues' => [ 'queue-id-1' => [ 'name' => 'foo', 'connection' => 'default', 'config' => [ 'durable' => true, 'bind' => [ [ 'topic' => 't1', 'routing_key' => 'some-routing-key', ], ], ], ], ], 'publishers' => [ 'publisher-1' => [ 'topic' => 'topic-id-1', 'config' => [], ], ], 'consumers' => [ 'c1' => [ 'queue' => 'queue-id-1', 'processor' => function (\Interop\Amqp\AmqpMessage $message) { echo vsprintf('Message body size: %s', [mb_strlen($message->getBody())]) . PHP_EOL; return Processor::REQUEUE; }, 'config' => [ 'receive_timeout' => 30, 'qos' => [ 'enabled' => false, 'prefetch_size' => 0, 'prefetch_count' => 0, 'global' => false, ] ], ], ], ]; $carrot = new CarrotMQ($config); $consumer = $carrot->container()->consumers()->get('c1'); $extension = new SignalExtension(); /** * @var BinaryCube\CarrotMQ\Consumer $consumer */ $consumer->extensions()->add($extension::name(), $extension); $consumer->consume();
Bugs and feature requests
Have a bug or a feature request? Please first read the issue guidelines and search for existing and closed issues. If your problem or idea is not addressed yet, please open a new issue.
Contributing guidelines
All contributions are more than welcomed. Contributions may close an issue, fix a bug (reported or not reported), add new design blocks, improve the existing code, add new feature, and so on. In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. Read the full Code of Conduct.
Versioning
Through the development of new versions, we're going use the Semantic Versioning.
Example: 1.0.0.
- Major release: increment the first digit and reset middle and last digits to zero. Introduces major changes that might break backward compatibility. E.g. 2.0.0
- Minor release: increment the middle digit and reset last digit to zero. It would fix bugs and also add new features without breaking backward compatibility. E.g. 1.1.0
- Patch release: increment the third digit. It would fix bugs and keep backward compatibility. E.g. 1.0.1
Authors
- Banciu N. Cristian Mihai
See also the list of contributors who participated in this project.
License
This project is licensed under the MIT License - see the LICENSE file for details.
binary-cube/carrot-mq 适用场景与选型建议
binary-cube/carrot-mq 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 222 次下载、GitHub Stars 达 0, 最近一次更新时间为 2019 年 11 月 26 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「php」 「MQ」 「message queue」 「rabbit-mq」 「carrot」 「carrot-mq」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 binary-cube/carrot-mq 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 binary-cube/carrot-mq 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 binary-cube/carrot-mq 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
PHP AMQP Binding Library
A Laravel package to monitor queue jobs.
Message queue statistics for OroPlatform
Redis backed library for creating background jobs and processing them later.
Behat extention for RabbitMQ
Alfabank REST API integration
统计信息
- 总下载量: 222
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 6
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-11-26