QUEUE_CONNECTION 'database' 有效但 'redis' 抛出 'Array to String conversion'

QUEUE_CONNECTION 'database' works but 'redis' throws 'Array to String conversion'

我只是想 运行 事件和监听器循环并将模型传递给它

event(new LabelsCreated($model, 'string'));

这与 QUEUE_CONNECTION=database 完美配合,但与 QUEUE_CONNECTION=redis 配合使用时会抛出错误:

#message: "Array to string conversion"

#code: 0

#file: "/home/vagrant/Code/Upworks/myproj/vendor/laravel/framework/src/Illuminate/Queue/RedisQueue.php"

#line: 302

#severity: E_NOTICE

我的活动 class 看起来像这样:

class LabelsCreated
{
    use Dispatchable, SerializesModels;

    public $model;

    public $string;

    public function __construct($model, $string)
    {
        $this->model = $model;
        $this->string = $string;

        // comes here
    }
}

但它根本不排队我的听众。


我的config/queue.php,redis数组是这样的:

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

可能指的是键 'queue' 值?

这是我的 config/queue 中的问题。php

'redis' => [
        'driver' => 'redis',
        'connection' => 'default',
        'queue' => ['default', 'export'], // THIS LINE
        'retry_after' => 90,
        'block_for' => null,
 ],

我试着保持默认

'queue' => 'default'

它 运行 同一连接上的多个队列。

深入洞察:https://laracasts.com/discuss/channels/laravel/multiple-queues-for-redis-connection?page=0#reply=461404