baywa-re-lusy / queue
BayWa r.e. LUSY Queue Tools
3.4.0
2024-02-01 16:25 UTC
Requires
- php: >= 8.1
- aws/aws-sdk-php: ^3.173
- microsoft/azure-storage-queue: ^1.3.4
- symfony/console: ^6.2
Requires (Dev)
- phpstan/phpstan: ^1.10
- phpunit/phpunit: ^10.5
- squizlabs/php_codesniffer: ^3.5
README
Installation
To install the Queue tools, you will need Composer in your project:
composer require baywa-re-lusy/queue
Usage
Currently, this library supports AWS SQS and Azure Queue. However, it uses an Adapter pattern to allow adding other vendors easily.
AWS
use BayWaReLusy\QueueTools\QueueService; use BayWaReLusy\QueueTools\Adapter\AwsSqsAdapter; $adapter = new AwsSqsAdapter($awsRegion, $awsKey, $awsSecret, $sqsEndpoint); $queueService = new QueueService($adapter);
The SQS endpoint is optional and is only necessary for non-AWS SQS-providers (like ElasticMQ).
Azure
use BayWaReLusy\QueueTools\QueueService; use BayWaReLusy\QueueTools\Adapter\AzureQueueAdapter; $adapter = new AzureQueueAdapter($queueEndpoint, $sasToken); $queueService = new QueueService($adapter);
If the queue Endpoint doesn't refer to azure (xxx.core.windows.net), it will use the local instance of Azurite instead with default values