定制 human-element/module-advanced-message-queue-options 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

human-element/module-advanced-message-queue-options

Composer 安装命令:

composer require human-element/module-advanced-message-queue-options

包简介

Module that allows advanced configuration of the message queue system

README 文档

README

This module adds the ability to set a directory for the message queue consumers PIDs under the var directory.

That way you can share that directory and not loose track of the PIDs between deployments

It also gives you a CLI command to create an updated poison pill version.

This allows you to choose at the end of a deployment to have Magento restart the consumers

It is also recommended to install a patch to get the consumers_wait_for_messages feature that way even when there is no messages to process between deployments and thus your poison pill won't kill the process you will know a new process with your new deployment directory will be started.

Installation

composer require human-element/module-advanced-message-queue-options
php bin/magento module:enable HumanElement_AdvancedMessageQueueOptions
php bin/magento setup:upgrade

Changing Consumer PIDs to a directory

You can change to use a directory under var for your message consumer PIDs using the following option in your env.php

return array (
    'cron_consumers_runner' => array(
        'pid_dir' => 'mqpid'
    )
);

This will put the message queue PIDs into var/mqpid instead of the root of var

This will put a new poison pill version into the database causing all the consumers to restart the process on the next message

php bin/magento he:queue:consumers:poison

Recommended Patch

This is the patch file

composer patches json config:

{
  "patches": {
    "magento/framework-message-queue": {
      "Adds message queue option consumers_wait_for_messages from https://github.com/magento/magento2/commit/4e960c31bf345f59a4eccc16832a3a737d4ce8b8 ": "patches/composer/message-consumer-wait-for-messages-option.patch"
    }
  }
}

Patch Usage

This adds the consumers_wait_for_messages option to set in your env.php

return array (
    'queue' => array(
        'consumers_wait_for_messages' => false
    )
);

This option fixes consumers causing issues with running to long, but it also causes annother issue where unnecessary memory is being used to spawn processes that kill themselfs every minute: https://github.com/magento/architecture/pull/232/files Fixes one problem and causes another, least for now, the above proposal is a detect if there is messages and only spawn consumers when they exists option.

Related Issues

magento/magento2#23540

magento/magento2#17951

magento/community-features#181

magento/architecture#232

https://github.com/magento/magento2/commit/4e960c31bf345f59a4eccc16832a3a737d4ce8b8

human-element/module-advanced-message-queue-options 适用场景与选型建议

human-element/module-advanced-message-queue-options 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 15.26k 次下载、GitHub Stars 达 4, 最近一次更新时间为 2019 年 10 月 11 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 human-element/module-advanced-message-queue-options 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 human-element/module-advanced-message-queue-options 我们能提供哪些服务?
定制开发 / 二次开发

基于 human-element/module-advanced-message-queue-options 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 15.26k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 4
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 4
  • Watchers: 4
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2019-10-11