当前位置: 首页 > 软件库 > Web应用开发 > Web框架 >

laravel-failed-job-monitor

Get notified when a queued job fails
授权协议 MIT License
开发语言 PHP
所属分类 Web应用开发、 Web框架
软件类型 开源软件
地区 不详
投 递 者 严亮
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

Get notified when a queued job fails

This package sends notifications if a queued job fails. Out of the box it can send a notification via mail and/or Slack. It leverages Laravel's native notification system.

Support us

We invest a lot of resources into creating best in class open source packages. You can support us by buying one of our paid products.

We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on our contact page. We publish all received postcards on our virtual postcard wall.

Installation

For Laravel versions 5.8 and 6.x, use v3.x of this package.

You can install the package via composer:

composer require spatie/laravel-failed-job-monitor

If you intend to use Slack notifications you should also install the guzzle client:

composer require guzzlehttp/guzzle

The service provider will automatically be registered.

Next, you must publish the config file:

php artisan vendor:publish --tag=failed-job-monitor-config

This is the contents of the default configuration file. Here you can specify the notifiable to which the notifications should be sent. The default notifiable will use the variables specified in this config file.

return [

    /**
     * The notification that will be sent when a job fails.
     */
    'notification' => \Spatie\FailedJobMonitor\Notification::class,

    /**
     * The notifiable to which the notification will be sent. The default
     * notifiable will use the mail and slack configuration specified
     * in this config file.
     */
    'notifiable' => \Spatie\FailedJobMonitor\Notifiable::class,

    /**
     * The channels to which the notification will be sent.
     */
    'channels' => ['mail', 'slack'],

    'mail' => [
        'to' => 'email@example.com',
    ],

    'slack' => [
        'webhook_url' => env('FAILED_JOB_SLACK_WEBHOOK_URL'),
    ],
];

Configuration

Customizing the notification

The default notification class provided by this package has support for mail and Slack.

If you want to customize the notification you can specify your own notification class in the config file.

// config/laravel-failed-job-monitor.php
return [
    ...
    'notification' => \App\Notifications\CustomNotificationForFailedJobMonitor::class,
    ...

Customizing the notifiable

The default notifiable class provided by this package use the channels, mail and slack keys from the config file to determine how notifications must be sent

If you want to customize the notifiable you can specify your own notifiable class in the config file.

// config/laravel-failed-job-monitor.php
return [
    'notifiable' => \App\CustomNotifiableForFailedJobMonitor::class,
    ...

Usage

If you configured the package correctly, you're done. You'll receive a notification when a queued job fails.

Changelog

Please see CHANGELOG for more information what has changed recently.

Testing

composer test

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email freek@spatie.be instead of using the issue tracker.

Credits

A big thank you to Egor Talantsev for his help creating v2 of the package.

License

The MIT License (MIT). Please see License File for more information.

  • 运行队列处理器 队列处理器的设置 Laravel 包含一个队列处理器,当新任务被推到队列中时它能处理这些任务。你可以通过 queue:work 命令来运行处理器。要注意,一旦 queue:work 命令开始,它将一直运行,直到你手动停止或者你关闭控制台: php artisan queue:work 可以指定队列处理器所使用的连接。 php artisan queue:work redis 可以自

  • 可用命令 clear-compiled 删除编译后的类文件 db 启动一个新的数据库 CLI 会话 down 将应用程序置于维护/演示模式 env 显示当前框架环境 help 显示命令的帮助 inspire 显示鼓舞人心的名言 list 列出命令 migrate 运行数据库迁移 optimize 缓存框架引导文件 serve 在 PHP 开发服务器上为应用程

 相关资料
  • 我的项目是SpringBoot(版本2.0.9.RELEASE)整合spring-boot-starter-quartz。代码完全来自于这篇博客代码来源,我在启动项目后,报错: 这个问题网上也有相关的问题,但是他们的答案我一直尝试不成功。 大部分回答都是AdaptableJobFactory的里面用的反射有问题,说要重写AdaptableJobFactory(https://blog.csdn.n

  • Job

    Job负责批处理任务,即仅执行一次的任务,它保证批处理任务的一个或多个Pod成功结束。 Job Spec格式 spec.template格式同Pod RestartPolicy仅支持Never或OnFailure 单个Pod时,默认Pod成功运行后Job即结束 .spec.completions标志Job结束需要成功运行的Pod个数,默认为1 .spec.parallelism标志并行运行的Pod

  • HTTP 417 Expectation Failed客户端错误响应代码指示Expect无法满足请求标头中给出的期望值。 查看Expect标题了解更多详情。 状态 417 Expectation Failed 规范 规范 标题 RFC 7231,第6.5.14节:417期望失败 超文本传输协议(HTTP / 1.1):语义和内容 也可以看看 Expect

  • HTTP 412 Precondition Failed客户端错误响应代码指示对目标资源的访问已被拒绝。这种情况与上比其他方法条件请求GET或者HEAD当被定义的条件If-Unmodified-Since或If-None-Match头部不被满足。在这种情况下,无法进行请求(通常是上载或修改资源),并且发送此错误响应。 状态 412 Precondition Failed 规范 规范 标题 RFC

  • Job Monarch 是 Ganglia 监控系统的插件,提供了批量作业监控。支持 Torque, PBS, 和 SLURM, 对 LSF 和 SGE 的支持还处于体验阶段。

  • 蓝鲸作业平台(Job)是一套运维脚本管理系统,具备海量任务并发处理能力。除了支持脚本执行、文件分发、定时任务等一系列基础运维场景以外,还支持通过流程调度能力将零碎的单个任务组装成一个自动化作业流程;而每个作业都可做为一个原子节点,提供给上层或周边系统/平台使用,实现跨系统调度自动化。 Benefits 安全可靠的高危命令检测能力 作为底层面向服务器OS的原子操作平台,对用户操作指令是否合规、安全的