Skip to content

Azure Storage Queue transport for Symfony's Messenger component.

License

Notifications You must be signed in to change notification settings

alexandrubau/messenger-azure-queue-transport

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

messenger-azure-queue-transport

Azure Queue transport for Symfony's Messenger component.

Travis (.org) Packagist Version Software License

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.

Further reading

  1. The Messenger Component
  2. Messenger: Sync & Queued Message Handling
  3. Azure Storage Queue
  4. Azure Storage Queue REST API