- How do I integrate Azure Queue Storage with Laravel’s Messenger component using this package?
- Install via Composer (`composer require alexandrubau/messenger-azure-queue-transport`), configure the transport in `config/queue.php` with your Azure credentials, and set the `driver` to `azure-queue`. The package extends Laravel’s native Messenger, so no changes to job dispatchers or consumers are needed.
- Does this package support Laravel 10.x, and are there any breaking changes?
- Yes, the package supports Laravel 8.x/9.x/10.x with no breaking changes in v1.8.0. It’s designed as a drop-in replacement for Laravel’s default queue transports, ensuring backward compatibility. Always verify the latest release notes for edge cases.
- What’s the RedeliveryStamp feature, and how does it improve reliability?
- RedeliveryStamp tracks failed message retries, inspired by Symfony Messenger. It automatically handles retry logic for failed jobs, reducing manual error-handling code. This is critical for production-grade reliability, especially in distributed systems where messages might fail intermittently.
- Can I use this package without an existing Azure Storage account?
- No, you’ll need an Azure Storage account and a configured queue. The package doesn’t create queues automatically—you must set up the queue in Azure first. Use the `queue` option in your transport config to specify the queue name.
- How do I configure visibility timeouts or message TTL (Time-to-Live) in Azure Queue?
- Set `visibility_timeout` and `time_to_live` in your transport config (e.g., `config/queue.php`). These values control how long messages stay invisible after being processed and how long messages persist before expiring. Example: `'visibility_timeout' => 30, 'time_to_live' => 86400` for 30-second visibility and 24-hour TTL.
- Will this package work with Laravel Horizon for monitoring?
- Yes, but you may need custom logic to expose RedeliveryStamp metrics. Horizon tracks jobs by default, but retries require additional instrumentation. Consider logging retry events or integrating with Azure Monitor for comprehensive observability.
- What are the cost implications of using Azure Queue Storage at scale?
- Azure Queue Storage charges per transaction (e.g., add, peek, delete) and storage volume. Model costs based on your expected message volume, visibility timeouts, and retention periods. For high-throughput systems, monitor Azure’s pricing calculator to avoid surprises.
- How do I handle poison pills (messages that repeatedly fail) in this transport?
- Enable `redelivery_enabled` in your transport config to leverage RedeliveryStamp. For poison pills, implement custom logic in your job handler (e.g., throw a non-retryable exception like `PoisonPillException`) or use Azure’s dead-letter queue feature via the underlying `league/azure-queue` package.
- Are there alternatives to this package for Azure integration in Laravel?
- Yes, consider `spatie/laravel-azure-queue` for direct Azure Queue integration with Laravel’s native queue system (not Messenger). For other transports, AWS SQS (`aws/aws-sdk-php`) or RabbitMQ (`php-amqplib/php-amqplib`) are popular alternatives, depending on your ecosystem needs.
- How do I test this package in a staging environment before production?
- Start by configuring a non-critical queue in staging, then gradually migrate jobs. Use `MESSENGER_TRANSPORT_DSN` with a staging Azure account and monitor metrics (e.g., latency, failure rates) against your current transport. Test edge cases like network timeouts or large payloads.