3

I have a problem with laravel 5.1 queues. I have beanstalkd already set up in my Homestead vm so all i did was to change the queue driver from the default one to beanstalkd in config/queue.php. I've tried the code below and neither one seem to be queued. They all fired synchronously, as soon as i run the code. I didn't even fire the artisan queue:listen command. What am i doing wrong?

Route::get('/', function () {
//    return view('welcome');

    Queue::push(function($job)
    {
        Log::info("Dadas");
        $job->delete();
    });

    $input = [
        'name' => 'Mario Bašić',
        'email' => 'email@me.com',
        'comment' =>  'Testing queues',
        'subject' =>  'Email subject'
    ];

    Mail::queue('emails.test', $input, function($message) use ($input)
    {
        $message->to($input['email'], $input['name']);
        $message->subject($input['subject']);
        Log::info('sending');
    });
});
Dănuț Mihai Florian
  • 3,075
  • 3
  • 26
  • 44

1 Answers1

3

Make sure you change the driver in the .env file:

QUEUE_DRIVER=beanstalkd

Changing the value in the config/queue.php to:

'default' => env('QUEUE_DRIVER', 'beanstalkd'),

won't work if another value is set for QUEUE_DRIVER in .env.

Bogdan
  • 43,166
  • 12
  • 128
  • 129