kainxspirits / laravel-pubsub-queue
Queue driver for Google Cloud Pub/Sub.
Installs: 248 526
Dependents: 3
Suggesters: 0
Security: 0
Stars: 44
Watchers: 3
Forks: 36
Open Issues: 9
Requires
- php: >=8.1
- ext-json: *
- google/cloud-pubsub: ^1.1
- illuminate/queue: 5.7.* | 5.8.* | ^6.0 | ^7.0 | ^8.0 | ^9.0| ^10.0 | ^11.0
- illuminate/support: 5.7.* | 5.8.* | ^6.0 | ^7.0 | ^8.0 | ^9.0| ^10.0 | ^11.0
- ramsey/uuid: ^2.0|^3.0|^4.0
Requires (Dev)
- phpunit/phpunit: ^10.0
This package is auto-updated.
Last update: 2024-11-05 20:18:50 UTC
README
This package is a Laravel queue driver that uses the Google PubSub service.
Installation
You can easily install this package with Composer by running this command :
composer require kainxspirits/laravel-pubsub-queue
If you disabled package discovery, you can still manually register this package by adding the following line to the providers of your config/app.php
file :
Kainxspirits\PubSubQueue\PubSubQueueServiceProvider::class,
Configuration
Add a pubsub
connection to your config/queue.php
file. From there, you can use any configuration values from the original pubsub client. Just make sure to use snake_case for the keys name.
You can check Google Cloud PubSub client for more details about the different options.
'pubsub' => [ 'driver' => 'pubsub', 'queue' => env('PUBSUB_QUEUE', 'default'), 'queue_prefix' => env('PUBSUB_QUEUE_PREFIX', ''), 'project_id' => env('PUBSUB_PROJECT_ID', 'your-project-id'), 'retries' => 3, 'request_timeout' => 60, 'subscriber' => 'subscriber-name', 'create_topics' => true, 'create_subscriptions' => true, ],
Avoiding Administrator Operations Limits
To avoid limit issues, change the create_topics
and create_subscriptions
flags to false.
Testing
You can run the tests with :
vendor/bin/phpunit
License
This project is licensed under the terms of the MIT license. See License File for more information.