Skip to content

Local-Data-Exchange/laravel-pubsub-queue

This branch is 5 commits ahead of, 1 commit behind munir131/laravel-pubsub-queue:master.

Folders and files

NameName
Last commit message
Last commit date
Jan 11, 2024
Dec 10, 2021
Sep 5, 2018
Aug 12, 2019
Sep 5, 2018
Sep 5, 2018
Jul 7, 2023
Sep 5, 2018
Jul 7, 2023
Sep 5, 2018

Repository files navigation

Laravel PubSub Queue

This package is a Laravel 5.8 queue driver that use the Google PubSub service.

Installation

You can easily install this package with Composer by running this command :

composer require lde/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 :

PubSub\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('JOB_PUB'),
            'project_id' => env('PUBSUB_PROJECT_ID', 'your-project-id'),
            'retries' => 5,
            'request_timeout' => 60,
            'keyFilePath' => env('PUBSUB_KEY_FILE', storage_path('Asyncro-978055.json')),
            // Subscriber will be key and publisher will be value here
            'subscribers' => [
                'sub1' => 'topic1',
                'sub2' => 'topic2',
                'sub3' => 'topic2' // Multiple subscriber to single topic
            ],
            'plain_handlers' => [
                'plain_sub' => App\Jobs\PlainClass::class // This one for non laravel format messages.
            ],
        ],

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.

About

A Laravel queue driver for Google PubSub.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%