Skip to main content

Module azure

Module azure 

Source
Expand description

Azure Service Bus provider implementation.

This module provides production-ready Azure Service Bus integration with:

  • Native session support for ordered message processing
  • Connection pooling and sender/receiver caching
  • Dead letter queue integration
  • Multiple authentication methods (connection string, managed identity, client secret)
  • Comprehensive error classification for retry logic

§Authentication Methods

The provider supports four authentication methods:

  • ConnectionString: Direct connection string with embedded credentials
  • ManagedIdentity: Azure Managed Identity for serverless environments
  • ClientSecret: Service principal with tenant/client ID and secret
  • DefaultCredential: Default Azure credential chain for development

§Session Management

Azure Service Bus provides native session support with:

  • Strict FIFO ordering within session boundaries
  • Exclusive session locks during processing
  • Automatic lock renewal for long-running operations
  • Session state storage for stateful processing

§Example

use queue_runtime::{QueueClientFactory, QueueConfig, ProviderConfig, AzureServiceBusConfig, AzureAuthMethod};
use chrono::Duration;

let config = QueueConfig {
    provider: ProviderConfig::AzureServiceBus(AzureServiceBusConfig {
        connection_string: Some("Endpoint=sb://...".to_string()),
        namespace: None,
        auth_method: AzureAuthMethod::ConnectionString,
        use_sessions: true,
        session_timeout: Duration::minutes(5),
    }),
    ..Default::default()
};

let client = QueueClientFactory::create_client(config).await?;

Structs§

AzureServiceBusProvider
Azure Service Bus queue provider implementation using REST API
AzureSessionProvider
Azure Service Bus session provider for ordered message processing

Enums§

AzureAuthMethod
Authentication method for Azure Service Bus
AzureError
Azure Service Bus specific errors