Amazon's Laravel Queue with SQS

Hi, I am new to laravel 4, getting problems setting up AWS SQS on my local machine. I need to click some jobs in the AWS queue and execute them sequentially.

I set the required values ​​in app / config / queue.php

'sqs' => array( 'driver' => 'sqs', 'key' => 'XXXXXX', 'secret' => 'XXXXXX', 'queue' => 'https://sqs.us-west-2.amazonaws.com/XXXXXX/myqueue', 'region' => 'us-west-2', ), 

and also override the value of the queue in the application /config/local/queue.php

 $queue = include __DIR__ . "/../queue.php"; $queue['connections']['sqs']['queue'] = 'https://sqs.us-west-2.amazonaws.com/XXXXXXX/mylocalqueue'; return $queue; 

I also changed the updated bootstrap / start.php to set the environment as local

 <?php $env = $app->detectEnvironment(array( 'local' => array('my-machine-name'), )); 

I queued jobs in the controller function as follows

 public function pus_aws($data){ $queue = $this->app['queue']; $queue->push('\ ControllerName@ActionName ', array( 'data' => $data, )); return true; } 

But it does not work. Can someone help me click and run the task in the queue?

+6
source share
1 answer

Are you listening in line?

 php artisan queue:listen --env=your_environment 

http://laravel.com/docs/queues#running-the-queue-listener

For Production Setup, you must use a supervisor, as indicated in the Laravel Docs.

See this for a tutorial (uses beanstalkd, but the same for sqs, just so you don't need to install beanstalkd) http://fideloper.com/ubuntu-beanstalkd-and-laravel4

+3
source

All Articles