alexandrubau / messenger-azure-queue-transport
Azure Storage Queue transport for Symfony's Messenger component.
Installs: 18 951
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 2
Forks: 7
Open Issues: 3
Type:symfony-bundle
Requires
- php: ^7.3 || ^8.0
- microsoft/azure-storage-queue: ^1.3
- symfony/config: ^4.3|^5.0|^6.0|^7.0
- symfony/dependency-injection: ^4.3|^5.0|^6.0|^7.0
- symfony/http-kernel: ^4.3|^5.0|^6.0|^7.0
- symfony/messenger: ^4.3|^5.0|^6.0|^7.0
Requires (Dev)
- phpunit/phpunit: ^9.0|^10.0
- symfony/var-dumper: ^4.3|^5.0|^6.0|^7.0
README
Azure Queue transport for Symfony's Messenger component.
Installation
The messenger-azure-queue-transport component requires PHP 7.3+ and Symfony 4.3+.
You can install this component using Symfony Flex:
composer require alexandrubau/messenger-azure-queue-transport
Basic usage
Set environment variable:
MESSENGER_TRANSPORT_DSN=azurequeue://<account_name>:<account_key>@default
In case your Account Name or Account Key contain special characters, you can use PHP's rawurlencode()
function to encode them.
Set messenger transport config:
framework: messenger: transports: azure_queues: dsn: '%env(MESSENGER_TRANSPORT_DSN)%' options: queue_name: <your_queue_name> visibility_timeout: <visibility_timeout_in_seconds> time_to_live: <time_to_live_in_seconds> results_limit: <how_many_messages_to_read>
Options can be configured via the DSN or via the options key under the transport in messenger.yaml
. Example:
MESSENGER_TRANSPORT_DSN=azurequeue://<account_name>:<account_key>@default?queue_name=<your_queue_name>&visibility_timeout=<visibility_timeout_in_seconds>&time_to_live=<time_to_live_in_seconds>&results_limit=<how_many_messages_to_read>
Don't forget to create the queue with the supplied name in Azure Queue Storage.