kirschbaum/laravel-sns-subscription-queues
Composer 安装命令:
composer require kirschbaum/laravel-sns-subscription-queues
包简介
A Laravel package that allows the queueing system to deal with the non-laravel payload when subscribed to an AWS SNS topic.
README 文档
README
Laravel SNS Subscription Queues
Under Active Development
This package is actively being developed and should be considered experimental for the time being.
Laravel Version Support
Due to some changes that were made in Laravel version 5.1.20 this package currently only supports version 5.1.20 and higher. It does not support v5.2.0 or higher at this time.
Usage
This package extends the default Illuminate\Queue\QueueServiceProvider to handle queue payloads from SNS Topic subscriptions. It works by checking for a custom handler configuration in the event the Job doesn't meet the expected Laravel payload structure. If a custom queue handler has been configured this package then adds the necessary structure so that the queue system can process the Job.
Installation
Add the package to your project:
For now update your composer.json
"config": { "preferred-install": "dist" }, "minimum-stability": "dev"
then
composer require kirschbaum/laravel-sns-subscription-queues
Add the following service provider:
// config/app.php
'providers' => [
...
Kirschbaum\LaravelSnsSubscriptionQueues\ServiceProvider::class,
...
];
Publish the config file using the Artisan command:
php artisan vendor:publish --provider="Kirschbaum\LaravelSnsSubscriptionQueues\ServiceProvider"
The configuration looks like this:
<?php
return [
/*
|--------------------------------------------------------------------------
| Custom Handlers for SNS Subscription Queues
|--------------------------------------------------------------------------
|
| Here is where we map an ARN Topic to the Laravel Job handler that should
| process the queue payload.
|
*/
// Examples
'arn:aws:sns:us-east-1:012345667910:my-sns-topic-name' => 'App\\Jobs\\MyCustomHandler@handle',
'arn:aws:sns:us-east-1:012345667910:my-other-sns-topic-name' => 'App\\Jobs\\AnotherCustomHandler@handle',
];
Create a corresponding Laravel Job class to handle the payload:
<?php namespace App\Jobs;
use App\Jobs\Job;
use Illuminate\Queue\SerializesModels;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Bus\SelfHandling;
use Illuminate\Contracts\Queue\ShouldQueue;
class MyCustomHandler extends Job implements SelfHandling, ShouldQueue
{
use InteractsWithQueue, SerializesModels;
public function handle($sqs_job, $payload)
{
$this->setJob($sqs_job);
// Process the job here.
$this->delete();
}
}
Contributors
kirschbaum/laravel-sns-subscription-queues 适用场景与选型建议
kirschbaum/laravel-sns-subscription-queues 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1.38k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2016 年 05 月 23 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「aws-sns-payload」 「laravel-queue」 「custom-payload」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 kirschbaum/laravel-sns-subscription-queues 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 kirschbaum/laravel-sns-subscription-queues 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 kirschbaum/laravel-sns-subscription-queues 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Ecotone for Laravel — CQRS, Event Sourcing, Sagas, Durable Workflows, and Outbox on top of Laravel Queue, via PHP attributes.
The package contains useful utilities and classes.
Queue Adapter for Tencent Qcloud CMQ SDK
Native ext-amqp RabbitMQ queue driver for Laravel production workloads with connection pooling, publisher confirms, Horizon support, Octane support, quorum queues, and high-performance workers
Laravel subject sequence queue database
This package allows you to access the authenticated user while processing jobs in the queue.
统计信息
- 总下载量: 1.38k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 8
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2016-05-23