handcraftedinthealps/redis-transport-bundle
Composer 安装命令:
composer require handcraftedinthealps/redis-transport-bundle
包简介
A symfony messenger transport implementation for redis streams.
README 文档
README
A symfony messenger transport implementation for redis streams.
NOTE: Most of the logic has moved to the Core Symfony Messenger component in 4.3. So this bundle is not longer a requirement to use messenger with redis streams. You can now use the
redis://instead ofredis-stream://and remove this bundle from your requirements.
Requirements
- PHP:
^7.1- Redis Extension:
^4.2
- Redis Extension:
- Redis Server:
^5.0
Symfony compatibility
| Symfony Messenger Version | Bundle Version |
|---|---|
| 4.2 | 1.0 |
| 4.3 | 1.1 |
When upgrading to symfony 4.3 you should replace this bundle
with the symfony redis:// transport and remove the bundle
from your requirements.
Installation
You need composer to install this bundle to your symfony application.
composer require handcraftedinthealps/redis-transport-bundle
Configuration
Symfony
When using the symfony/framework-bundle you can configure the following:
# config/packages/framework.yaml framework: messenger: routing: 'HandcraftedInTheAlps\Bundle\RedisTransportBundle\Message\DomainEventMessage': senders: ['redis_stream'] transports: redis_stream: 'redis-stream://127.0.0.1:6379/my_stream/my_group/my_consumer'
You can then send a DomainEventMessage or your custom Message over the redis stream:
use HandcraftedInTheAlps\Bundle\RedisTransportBundle\Message\DomainEventMessage; $this->messageBus->dispatch( new DomainEventMessage( 'mountain.modified', // the custom event action 'mountain', // the model which has been changed '1', // the model id or uuid [ // the model payload 'id' => '1', 'name' => 'Piz Buin', 'height' => 3312, ] ) );
And you can consume the messages with:
bin/console messenger:consume-messages redis_stream
Have also a look at the messenger component documentation and messenger usage documentation.
Commands
Messages in streams won't be removed by default. Therefor this bundle provides a command:
bin/console redis-transport:trim <redis-dsn> --maxlen 1000
handcraftedinthealps/redis-transport-bundle 适用场景与选型建议
handcraftedinthealps/redis-transport-bundle 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 20.53k 次下载、GitHub Stars 达 6, 最近一次更新时间为 2018 年 11 月 20 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 handcraftedinthealps/redis-transport-bundle 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 handcraftedinthealps/redis-transport-bundle 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 20.53k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 6
- 点击次数: 21
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-11-20