aymdev/messenger-azure-bundle
AzureMessageStamp and AzureBrokerPropertiesStamp to attach Azure-specific metadata (e.g., topic/queue names, broker properties like TimeToLive, or ScheduledEnqueueTimeUtc). This is valuable for observability and debugging but may require custom handling in Laravel’s queue system (which lacks native stamp support).Illuminate\Queue\QueueManager) is not natively compatible with Symfony Messenger transports. However, Laravel’s bus facade or custom queue connectors (e.g., via Illuminate\Contracts\Queue\Queue) could theoretically wrap Symfony Messenger transports.queue:work with a custom QueueWorker that dispatches Symfony Messenger messages, or integrate Symfony Messenger as a middleware layer (e.g., via Laravel’s app() container).azure://KEY_NAME:KEY_VALUE@NAMESPACE). This is secure but may complicate secrets management (e.g., .env files or Azure Key Vault integration).peek-lock/receive-and-delete). This covers most use cases but may require additional logic for advanced ASB features (e.g., sessions, dead-letter queues).Illuminate\Queue\Jobs\Job), while Symfony Messenger is more feature-rich (e.g., middleware, retries, stamps). Bridging these may require boilerplate or custom abstractions.azure/azure-service-bus) might suffice.SerializerDecodingException, but Laravel’s queue system may not propagate these gracefully. Custom error handlers or middleware would be needed.peek-lock mode due to serialization errors could require manual intervention (e.g., via Azure Portal).http-client (PSR-18) suggests it could be adapted for Laravel’s Guzzle or HttpClient with minimal effort.Why Symfony Messenger?
Queue implementation wrap this bundle without Symfony Messenger?Serialization Strategy
AzureBrokerPropertiesStamp) suffice?Illuminate\Queue\Jobs\Job) map to Symfony Messenger messages?Authentication & Secrets
.env, Azure Key Vault, or a secrets manager)?Observability
AzureMessageStamp and AzureBrokerPropertiesStamp be logged or exposed in Laravel’s context (e.g., via Laravel Horizon or custom monitoring)?Scaling & Concurrency
queue:work --daemon vs. Symfony’s messenger:consume)?Migration Path
Dispatchable) be adapted to work with Symfony Messenger?Laravel + Symfony Messenger:
azure/azure-service-bus SDK directly with a custom Laravel queue driver.Azure Service Bus:
Serialization:
JMS\Serializer or Symfony\Component\Serializer).Assessment Phase:
Queue implementation).Proof of Concept:
Dispatchable classes).// Dispatch a Laravel job via Symfony Messenger
$message = new YourJob($data);
$this->bus->dispatch($message); // Assuming Symfony Messenger is bound to Laravel's bus
// Custom Queue class extending Illuminate\Queue\Queue
public function push($job, $data, $queue = null) {
$message = new SymfonyMessage($job, $data);
$this->messenger->dispatch($message);
}
Incremental Rollout:
TimeToLive).AzureBrokerPropertiesStamp to delay a message:
# messenger.yaml
transports:
azure_transport:
options:
entity_path: 'delayed-jobs'
// In a job
$message->setStamp(new AzureBrokerPropertiesStamp([
'ScheduledEnqueueTimeUtc' => (new \DateTime())->modify('+1 hour')->format('c'),
]));
Error Handling & Observability:
SerializerDecodingException to log failures (e.g., via Laravel’s logging or Sentry).// Listen to Symfony Messenger events (if using Symfony's event system)
$eventDispatcher->addListener(
'console.error',
fn ($event) => Logger::error('ASB decoding error', ['message' => $event->getMessage()])
);
FailedJob handler or queue failure callback.Laravel Versions:
Azure SDK vs. REST API:
How can I help you explore Laravel packages today?