定制 pnz/messenger-filesystem-transport-bundle 二次开发

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

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

pnz/messenger-filesystem-transport-bundle

Composer 安装命令:

composer require pnz/messenger-filesystem-transport-bundle

包简介

Symfony Bundle for the filesystem messenger transport.

README 文档

README

Latest Stable Version Total Downloads Latest Unstable Version License

Integrates the Filesystem Transport to Symfony.

Install

composer require pnz/messenger-filesystem-transport-bundle

This transport handles the filesystem:// schema, use the FilesystemTransportFactory to create the transport. Symfony configuration:

Configure the Filesystem transport:

#  config/packages/messenger.yaml
parameters:
  # Default ENV value: the queue messages will be stored in the `var/queue` folder,
  # The trailing `//` is required for match the `filesystem://` schema
  env(MESSENGER_TRANSPORT_DSN): "filesystem://%kernel.project_dir%/var/queue"

framework:
    messenger:
        transports:
            filesystem: '%env(resolve:MESSENGER_TRANSPORT_DSN)%'

        routing:
            App\Message\MyMessage: filesystem

Configuration

Check the Filesystem Transport documentation.

In short, the DSN includes the following query parameters:

  • compress: Enable/Disable compression of messages storage (gzinflate/gzdeflate), use compress=true (default: false)
  • loop_sleep: Define the sleep interval between loops in micro-seconds, use loop_sleep=MICRO-SECONDS (default: 500000)

Example:

# .env

# Enable compression, and sleep for 0.8 seconds during loops if the queue is empty
MESSENGER_TRANSPORT_DSN="filesystem://%kernel.project_dir%/var/queue/default?compress=true&loop_sleep=800000"

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-06-08