• laravel-queue-rabbitmq插件添加


    一、

    1. composer require vladimir-yuldashev/laravel-queue-rabbitmq:5.2
    2. composer update

    二、

    config/app.php文件中,providers数组中添加

    1. VladimirYuldashevLaravelQueueRabbitMQLaravelQueueRabbitMQServiceProvider::class,

    三、

     1 //在app/config/queue.php文件中,connections数组中添加
     2 
     3 'rabbitmq' => [
     4     'driver'                => 'rabbitmq',
     5  
     6     'host'                  => env('RABBITMQ_HOST', '127.0.0.1'),
     7     'port'                  => env('RABBITMQ_PORT', 5672),
     8  
     9     'vhost'                 => env('RABBITMQ_VHOST', '/'),
    10     'login'                 => env('RABBITMQ_LOGIN', 'guest'),
    11     'password'              => env('RABBITMQ_PASSWORD', 'guest'),
    12  
    13     'queue'                 => env('RABBITMQ_QUEUE'), // name of the default queue,
    14  
    15     'exchange_declare'      => env('RABBITMQ_EXCHANGE_DECLARE', true), // create the exchange if not exists
    16     'queue_declare_bind'    => env('RABBITMQ_QUEUE_DECLARE_BIND', true), // create the queue if not exists and bind to the exchange
    17  
    18     'queue_params'          => [
    19         'passive'           => env('RABBITMQ_QUEUE_PASSIVE', false),
    20         'durable'           => env('RABBITMQ_QUEUE_DURABLE', true),
    21         'exclusive'         => env('RABBITMQ_QUEUE_EXCLUSIVE', false),
    22         'auto_delete'       => env('RABBITMQ_QUEUE_AUTODELETE', false),
    23     ],
    24  
    25     'exchange_params' => [
    26         'name'        => env('RABBITMQ_EXCHANGE_NAME', null),
    27         'type'        => env('RABBITMQ_EXCHANGE_TYPE', 'direct'), // more info at http://www.rabbitmq.com/tutorials/amqp-concepts.html
    28         'passive'     => env('RABBITMQ_EXCHANGE_PASSIVE', false),
    29         'durable'     => env('RABBITMQ_EXCHANGE_DURABLE', true), // the exchange will survive server restarts
    30         'auto_delete' => env('RABBITMQ_EXCHANGE_AUTODELETE', false),
    31     ],
    32  
    33 ],

    四、在.env中添加

    1 QUEUE_DRIVER=rabbitmq
    2  
    3 RABBITMQ_HOST=127.0.0.1
    4 RABBITMQ_PORT=5672
    5 RABBITMQ_VHOST=/
    6 RABBITMQ_LOGIN=admin
    7 RABBITMQ_PASSWORD=admin
    8 RABBITMQ_QUEUE=queue_name

    更改参数为:

  • 相关阅读:
    1CSS与文档
    14交互活动:XHTML表单
    13开始制作表格:表格和列表
    12布置元素:布局和排版
    11高级网站构建:div和span
    10与元素亲密接触:盒元素(the box model)
    tp5.1 与vue ajax请求跨域的问题
    小程序父子组件互相传参,互相调用方法
    PHP/js数组与字符串的操作,字符串转数组,数组转字符串,去掉字符串最后一个字符,判断二维数组是否为空等
    easyui datagrid分页栏位置问题
  • 原文地址:https://www.cnblogs.com/chaihtml/p/10819446.html
Copyright © 2020-2023  润新知