定制 weedgood/googlecloud-pubsub-laravel-queue-driver 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

weedgood/googlecloud-pubsub-laravel-queue-driver

Composer 安装命令:

composer require weedgood/googlecloud-pubsub-laravel-queue-driver

包简介

Google Cloud PubSub driver for Laravel/Lumen Queue.

README 文档

README

A Google Cloud PubSub driver for Laravel/Lumen Queue.

CI Minimum PHP Version Software License

Installation

You can easily install this package via Composer using this command:

composer require twipi-group/googlecloud-pubsub-laravel-queue-driver

Laravel

Register this package by adding the following line to the autoloaded service providers of your config/app.php file:

TwipiGroup\GoogleCloudPubSubLaravelQueueDriver\GcServiceProviderQueue::class,

Lumen

For Lumen usage, the service provider should be registered manually as follow in your boostrap/app.php file:

$app->configure('queue');
$app->register(TwipiGroup\GoogleCloudPubSubLaravelQueueDriver\GcServiceProviderQueue::class);

Configuration

Add new connection named gcpubsub to your config/queue.php file. You can customize the following options directly from your .env file.

'gcpubsub' => [
    'driver' => 'gcpubsub',
    'project_id' => env('PUBSUB_PROJECT_ID', 'google-cloud-project-id'), // Google cloud project id
    'queue' => env('PUBSUB_QUEUE_DEFAULT', 'default'), // Default queue name corresponding to the gc pubsub topic
    'topic_suffix' => env('PUBSUB_TOPIC_SUFFIX', ''),
    'subscriber_suffix' => env('PUBSUB_SUBSCRIBER_SUFFIX', ''),
    'max_tries' => env('PUBSUB_JOB_MAX_TRIES', 1), // Number of times the job may be attempted.
    'retry_delay' => env('PUBSUB_JOB_RETRY_DELAY', 0), // Delay in seconds before retrying a job that has failed 
],

Running The Queue Worker

You may run the worker using the queue:work Artisan command. (Laravel documentation)

php artisan queue:work gcpubsub [--queue=myqueue]

When APP_DEBUG=true in your .env file, you can check google cloud subscribers from the queue worker output.

Tests

vendor/bin/phpunit tests

Contribution

You can contribute to this package by discovering bugs, opening issues or purpose new features.

Licence

This project is licensed under the terms of the MIT license. See License file for more information.

统计信息

  • 总下载量: 75
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-11-14

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固