A generic wrapper for queue libraries
Installs: 40 656
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 4
Forks: 1
Open Issues: 2
Requires
- php: >=7.3
- ext-json: *
- aws/aws-sdk-php: ^3.69
- php-amqplib/php-amqplib: ^2.8
Requires (Dev)
- doctrine/coding-standard: ^6.0
- jakub-onderka/php-parallel-lint: ^1.0
- mockery/mockery: ^1.2
- nikic/php-parser: ^4.0
- phpro/grumphp: ^0.15
- phpunit/phpunit: ^8.0
- povils/phpmnd: ^2.0
- sensiolabs/security-checker: ^5.0
- squizlabs/php_codesniffer: ^3.4
Suggests
- ext-sockets: Remove socket warnings when using RabbitMQ
This package is auto-updated.
Last update: 2025-03-01 00:20:01 UTC
README
This package has been designed to switch out queue providers using a Queue & Consumer interface. You can use this package with RabbitMQ & SQS to seamlessly switch between the two.
Requirements
- PHP >= 7.3
Install
Install via Composer:
composer require sykescottages/qu
Examples
In the examples
folder you can see how to use this with both providers. The interfaces are the same and you only need
to update the user credentials to match your environment.
We've bundled the queues in docker so you should be able to run examples locally if you clone this repository.
docker-compose up -d
will start the RabbitMQ and SQS containers and you can run the examples locally.
Supported Queues
RabbitMQ
Links
These links are only available when the docker container is running
Name | Link |
---|---|
Queue | http://localhost:48888 |
Management Console | http://localhost:29852 |
Options
Option | Description | Default | Values |
---|---|---|---|
blockingConsumer | Whether the consume method should block execution or only process 1 message | true | true/false |
prefetchSize | Get the limit of messages that can be consumed by the channel | null | any numeric value |
prefetchCount | The limit of messages that we fetch from the queue | 1 | any numeric value |
consumerTag | A tag for the consumer | default.consumer.tag | any value |
SQS
Links
These links are only available when the docker container is running
Name | Link |
---|---|
Queue | http://localhost:41662 |
Options
Option | Description | Default | Values |
---|---|---|---|
blockingConsumer | Whether the consume method should block execution or only process 1 message | true | true/false |
pollTime | Set the consumer to do short polling or long polling | 20 | 0-20 |
maxNumberOfMessagesPerConsume | The amount of messages each poll/consume will retrieve from the queue | 1 | 1-10 |