apache集成php7.3.5的详细步骤-自学php网
windows 2008r2+php5.6.28环境搭建详细过程-自学php网
PHP 代码简洁之道(小结)-自学php网
php设计模式之单例模式用法经典示例分析-自学php网
redis+php实现微博(三)微博列表功能详解-自学php网
redis+php实现微博(一)注册与登录功能详解-自学php网
redis+php实现微博(二)发布与关注功能详解-自学php网
php设计模式之工厂模式用法经典实例分析-自学php网
php文件包含的几种方式总结-自学php网
smarty模板的使用方法实例分析-自学php网
PHP MVC框架中类的自动加载机制实例分析-自学php网
php+redis实现消息队列功能示例详解-自学php网
php写入txt乱码的解决方法-自学php网
php写入mysql中文乱码的实例解决方法-自学php网
php校验公钥是否可用的实例方法-自学php网
PHP实现的文件浏览器功能简单示例-自学php网
php创建多级目录与级联删除文件的方法示例-自学php网
PHP中将一个字符串部分字符用星号*替代隐藏的实现代码详解-自学php网
分析PHP7 的垃圾回机制详解-自学php网
PHP实现跨服务器session共享的方法教程-自学php网
ADS

Laravel使用RabbitMQ的方法示例-自学php网

来源:      时间: 2019-08-01 11:26:00     阅读数:3287 次     作者:

摘要: php家园网提供大量免费、原创、高清的php视频教程,并定期举行公益php培训!可边学习边在线修改示例代码,查看执行效果!php从入门到精通,一站式php自学平台! ...


300-250
导语安装 docker-compose stop workspace php-fpm php-worker docker-compose up -d workspace php-fpm php-worker rabbitmq扩展包安装以及配置 接下来在燾onfig/queue.php 文件中燾onnections 添加爎abbitmq 配置,根据情况自行修改'rabbitmq' => [ 'driver' => 'rabbitmq', /* * Set to "horizon" if you wish to use Laravel Horizon. */ 'worker' => env('RABBITMQ_WORKER', 'default'), 'dsn' => env('RABBITMQ_DSN', null), /* * Could be one a class that implements \Interop\Amqp\AmqpConnectionFactory for example: * - \EnqueueAmqpExt\AmqpConnectionFactory if you install enqueue/amqp-ext * - \EnqueueAmqpLib\AmqpConnectionFactory if you install enqueue/amqp-lib * - \EnqueueAmqpBunny\AmqpConnectionFactory if you install enqueue/amqp-bunny */ 'factory_class' => Enqueue\AmqpLib\AmqpConnectionFactory::class, 'host' => env('RABBITMQ_HOST', '127.0.0.1'), 'port' => env('RABBITMQ_PORT', 5672), 'vhost' => env('RABBITMQ_VHOST', '/'), 'login' => env('RABBITMQ_LOGIN', 'guest'), 'password' => env('RABBITMQ_PASSWORD', 'guest'), 'queue' => env('RABBITMQ_QUEUE', 'default'), 'options' => [ 'exchange' => [ 'name' => env('RABBITMQ_EXCHANGE_NAME'), /* * Determine if exchange should be created if it does not exist. */ 'declare' => env('RABBITMQ_EXCHANGE_DECLARE', true), /* * Read more about possible values at https://www.rabbitmq.com/tutorials/amqp-concepts.html */ 'type' => env('RABBITMQ_EXCHANGE_TYPE', \Interop\Amqp\AmqpTopic::TYPE_DIRECT), 'passive' => env('RABBITMQ_EXCHANGE_PASSIVE', false), 'durable' => env('RABBITMQ_EXCHANGE_DURABLE', true), 'auto_delete' => env('RABBITMQ_EXCHANGE_AUTODELETE', false), 'arguments' => env('RABBITMQ_EXCHANGE_ARGUMENTS'), ], 'queue' => [ /* * Determine if queue should be created if it does not exist. */ 'declare' => env('RABBITMQ_QUEUE_DECLARE', true), /* * Determine if queue should be binded to the exchange created. */ 'bind' => env('RABBITMQ_QUEUE_DECLARE_BIND', true), /* * Read more about possible values at https://www.rabbitmq.com/tutorials/amqp-concepts.html */ 'passive' => env('RABBITMQ_QUEUE_PASSIVE', false), 'durable' => env('RABBITMQ_QUEUE_DURABLE', true), 'exclusive' => env('RABBITMQ_QUEUE_EXCLUSIVE', false), 'auto_delete' => env('RABBITMQ_QUEUE_AUTODELETE', false), 'arguments' => env('RABBITMQ_QUEUE_ARGUMENTS'), ], ], /* * Determine the number of seconds to sleep if there's an error communicating with rabbitmq * If set to false, it'll throw an exception rather than doing the sleep for X seconds. */ 'sleep_on_error' => env('RABBITMQ_ERROR_SLEEP', 5), /* * Optional SSL params if an SSL connection is used * Using an SSL connection will also require to configure your RabbitMQ to enable SSL. More details can be founds here: https://www.rabbitmq.com/ssl.html */ 'ssl_params' => [ 'ssl_on' => env('RABBITMQ_SSL', false), 'cafile' => env('RABBITMQ_SSL_CAFILE', null), 'local_cert' => env('RABBITMQ_SSL_LOCALCERT', null), 'local_key' => env('RABBITMQ_SSL_LOCALKEY', null), 'verify_peer' => env('RABBITMQ_SSL_VERIFY_PEER', true), 'passphrase' => env('RABBITMQ_SSL_PASSPHRASE', null), ],],RABBITMQ_WORKER=horizonRABBITMQ_HOST=rabbitmqRABBITMQ_PORT=5672RABBITMQ_LOGIN=guestRABBITMQ_PASSWORD=guestRABBITMQ_QUEUE=default参考资料:laravel-queue-rabbitmq 以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持自学php网。

700-90


顶一下
(1)
100%
踩一下
(0)
0%

特别声明:本文为 PHP家园 自媒体平台 作者上传并发布,仅代表该作者观点。PHP家园 仅提供信息发布 平台。
本站全部内容均为 PHP家园 军迷娱乐与生活分享与个人的看法,不涉及任何军事与政治内容,图片与文章均来自网络,如有任何内容您觉得不妥,请立刻联系网站管理员给予删除!

查看原文      
最新评论   点击评论  
您好!没有相关评论,请 点击评论


表情删除后不可恢复,是否删除
取消
确定
图片正在上传,请稍后...
评论内容为空!
还没有评论,快来抢沙发吧!
点击查看更多精彩内容

最新资讯

最新文章

返回顶部