AzureStorageQueueProcessor

Processes messages from Azure Storage Queues and dispatches them to registered message handlers.

Syntax

public class AzureStorageQueueProcessor : IQueueProcessor

Inheritance

Implements

Constructors

AzureStorageQueueProcessor

public AzureStorageQueueProcessor(IMessageDispatcher dispatcher, IServiceScopeFactory serviceScopeFactory)
Initializes a new instance of the class.

Parameters

  • dispatcher IMessageDispatcher: The message dispatcher to route messages to handlers.
  • serviceScopeFactory IServiceScopeFactory: The service scope factory for creating DI scopes per message.

Exceptions

  • [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception): Thrown when dispatcher or serviceScopeFactory is null.

Methods

ProcessQueue

public Task<QueueMessage> ProcessQueue(QueueMessage queueMessage, ILogger logger)
Processes a message from the Azure Storage Queue and dispatches it to registered handlers.

Parameters

  • queueMessage QueueMessage: The Azure Storage Queue message to process.
  • logger ILogger: The logger instance for this processing operation.

Returns

Task<QueueMessage> The processed queue message, which will be moved to the completed queue if configured.

Remarks

This processor integrates with Azure WebJobs to automatically trigger message processing when messages arrive in Azure Storage Queues. It handles message deserialization, lifecycle management, and provides proper logging and dependency injection scope for each message.