美文网首页
config/queue.php

config/queue.php

作者: 爱折腾的傻小子 | 来源:发表于2018-10-29 11:01 被阅读9次
  • 队列配置文件源码
<?php

return [

    /*
    |--------------------------------------------------------------------------
    | Default Queue Driver
    |--------------------------------------------------------------------------
    |
    | Laravel's queue API supports an assortment of back-ends via a single
    | API, giving you convenient access to each back-end using the same
    | syntax for each one. Here you may set the default queue driver.
    |
    | Supported: "sync", "database", "beanstalkd", "sqs", "redis", "null"
    |
    */
    # sync PHP扩展
    # database : 使用数据库保存队列数据
    # beanstalkd
    # sqs :亚马逊 简单队列服务 提供队列服务
    # redis : redis 保存队列数据
    # null : 不使用队列
    'default' => env('QUEUE_DRIVER', 'sync'),

    /*
    |--------------------------------------------------------------------------
    | Queue Connections
    |--------------------------------------------------------------------------
    |
    | Here you may configure the connection information for each server that
    | is used by your application. A default configuration has been added
    | for each back-end shipped with Laravel. You are free to add more.
    |
    */

    'connections' => [

        'sync' => [
            'driver' => 'sync',
        ],

        # 队列database配置参数列表
        'database' => [
            'driver' => 'database',    //> database 数据库服务
            'table' => 'jobs',             //> 队列所使用的表名称 jobs
            'queue' => 'default',      //> 默认队列名称default可以设置多个名称如default,mail
            // 该配置项的目的是定义任务在执行以后多少秒后释放回队列。
            // 如果retry_after 设定的值为 90, 任务在运行 90 秒后还未完成,那么将被释放回队列而不是删除掉。
           // 毫无疑问,你需要把 retry_after 的值设定为任务执行时间的最大可能值
            'retry_after' => 90,                ],

        'beanstalkd' => [
            'driver' => 'beanstalkd',
            'host' => 'localhost',
            'queue' => 'default',
            'retry_after' => 90,
        ],

        'sqs' => [
            'driver' => 'sqs',
            'key' => 'your-public-key',
            'secret' => 'your-secret-key',
            'prefix' => 'https://sqs.us-east-1.amazonaws.com/your-account-id',
            'queue' => 'your-queue-name',
            'region' => 'us-east-1',
        ],

        'redis' => [
            'driver' => 'redis',
            'connection' => 'default',
            'queue' => 'default',
            'retry_after' => 90,
        ],

    ],

    /*
    |--------------------------------------------------------------------------
    | Failed Queue Jobs
    |--------------------------------------------------------------------------
    |
    | These options configure the behavior of failed queue job logging so you
    | can control which database and table are used to store the jobs that
    | have failed. You may change them to any database / table you wish.
    |
    */

    # 队列执行失败配置参数
    'failed' => [
        # 队列保存失败 链接数据库默认mysql
        'database' => env('DB_CONNECTION', 'mysql'),
        # 队列保存失败 保存数据库表 failed_jobs 中
        'table' => 'failed_jobs',
    ],

];

相关文章

  • config/queue.php

    队列配置文件源码

  • laravel 队列

    laravel队列文档 1.概念理解 连接(connections ):config/queue.php中有一个c...

  • Laravel 5.2 Queue队列基于Windows实现

    场景 需要耗时的任务 为了保证送达率,出错后需要重试的任务 配置 底层配置文件是config/queue.php ...

  • 队列

    队列使用目的:将耗时的任务延时处理。(比如说发邮件等) 队列的配置文件在 config/queue.php 中 连...

  • Laravel - retry_after 与 timeout

    任务执行时间 在配置文件config/queue.php中,每个连接都定义了retry_after项。该配置项的目...

  • laravel config queue

    queue.php default 注释翻译: 个人理解:队列的默认执行方式。sync 是直接执行, null 是...

  • Laravel队列及supervisor

    队列 参考文档 使用 创建失败数据库 queue.php配置 SendSmsJob类 调用 测试php artis...

  • laravel使用队列 --- 2021-09-30

    先去配置文件中queue.php文件中你选择的是哪种驱动方式image.png 去.env中设置,我这里设置的是d...

  • info There appears to be trouble

    yarn config delete proxynpm config rm proxynpm config rm ...

  • config

    请求config-server: 如果有label的话,即版本号,需要在后面拼接上/版本号,例如/1.08.20

网友评论

      本文标题:config/queue.php

      本文链接:https://www.haomeiwen.com/subject/dvropxtx.html