承接 digicomp/flow-symfony-bridge-messenger 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

digicomp/flow-symfony-bridge-messenger

最新稳定版本:0.1.0

Composer 安装命令:

composer require digicomp/flow-symfony-bridge-messenger

包简介

Flow dependency injection bridge to symfony/messenger

README 文档

README

Build status

This packages brings a DI configuration for the symfony/messenger component, so it can be used easily in neos/flow projects.

To see how to use it, you probably want to have a look at the documentation of symfony/messenger.

Getting started

To get it integrated, you all need to do is to get message bus injected:

    #[Flow\Inject]
    protected MessageBusInterface $messageBus;

And later in your method:

    $this->messageBus->dispatch(new CustomMessage())

You should configure a routing, to let the messenger know, over which transport your message should be handled:

DigiComp:
  FlowSymfonyBridge:
    Messenger:
      transports:
        "custom-messages":
          dsn: "flow-doctrine://default?table_name=test_messenger_messages"
      routing:
        Acme\Vendor\Messenger\CustomMessage:
          - "custom-messages"

In this example we are using a doctrine transport (the speciality "flow-transport" is a transport which uses the already existing connection to doctrine instead of creating a new one - for the rest of the DSN-Format have a look in the documentation of symfony/messenger)

A handler for your CustomMessage could look like this:

use Symfony\Component\Messenger\Attribute\AsMessageHandler;

#[AsMessageHandler]
class CustomMessageHandler
{
    public function __invoke(CustomMessage $message)
    {
        //your code here
    }
}

It will be automatically found by Flow // the messenger and messages arriving at the bus will be handled by your handler.

Probably you'll want to consume the messengers with long living processes or as a cronjob. The Flow command for that task is messenger:consume (more help available)

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-02-18

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固