0
votes

I am New to AWS SQS and Laravel. By following the Laravel 5.2 documentation I have dispatched $customer_id(integer) to AWS SQS.

Controller Code:

$this->dispatch(new ExampleJob($customer_id));

ExampleJob Code: [app\jobs

public function handle(Mailer $mailer)
{
     $mailer->send('Customer.Queue', ['Customer' => $this->customer],  function ($m) {

//            });

Whenever I POST data through controller, new message($customer_id) gets inserted in SQS Queue.That's good.

Now My problem is I am stuck in processing the messages in SQS queue. I need to process each customer ID and insert record to another Application(like NetSuite). How to process SQS queue running Queue Listener? Please Help me and correct me if I am wrong.

1

1 Answers

0
votes

you need then to run the queue listener, as explained in:

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

php artisan queue:listen

See that this listener will be dispatching all the jobs...

I developed this listener in a JAR to make it simpler, because once that you have a huge amount of jobs, the normal listener it is not efficiently at all, and it consumes a lot of resources.

https://github.com/smaugho/TunedQueue