williamrijksen/symfony-messenger-azure
Composer 安装命令:
composer require williamrijksen/symfony-messenger-azure
包简介
Azure adapter for symfony/messenger component
README 文档
README
This is an experimental Receiver/Sender on Azure for the symfony/messenger component for topic and subscribers.
Quick start
First of all: This uses topics / subscriptions like described here. Make sure you have a connection-string ready.
For now we're exposing a bundle which is pre-configuring the Messenger component with receivers and senders.
composer require symfony/messenger williamrijksen/symfony-messenger-azure
Add the bundle new WilliamRijksen\AzureMessengerAdapter\Bundle\AzureMessengerAdapterBundle().
Add the following configuration:
azure_messenger_adapter: azure: connectionString: 'Endpoint=<your token>' subscriptionName: 'name of subscription' #topic will be automatically created by this bundle messages: 'App\Message\Foo': 'foo_topic' #topic will be automatically created by this bundle
Add a message handler:
<?php namespace App\MessageHandler; use App\Message\Foo; final class FooHandler { public function __invoke(Foo $message) { } }
Tag it:
services: App\MessageHandler\FooHandler: tags: - { name: messenger.message_handler }
You're done!
Launch bin/console messenger:consume-messages azure_messenger.receiver.foo_queue and dispatch messages from the bus:
<?php $bus->dispatch(new Foo());
Configuration reference
azure_messenger_adapter: azure: connectionString: 'Endpoint=<your token>' subscriptionName: 'name of subscription' messages: 'App\Message\Foo': 'foo_topic'
Links
统计信息
- 总下载量: 375
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 7
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-12-11