#StackBounty: #php #amazon-web-services #laravel-5 #amazon-sqs #amazon-sns How to use Laravel 5 to receive Amazon SNS message from SQS?

Bounty: 50

I am trying to get the email response (bounce, complaint and delivery) from Amazon SES through SNS. On Amazon SQS console, I see that the message is already in the queue, so I am sure the setting for structures on Amazon is correct.

Then, using Laravel 5.5, following the official guide, I set up a queue listening to SQS. I skip the part of dispatching jobs to the queue as this will be done by SNS. In the job handler, for simplicity, I just var_dump what I receive. The job looks like this:

public function handle($testing_message)
    echo "testing handle!n";

The config for that looks something like this:

'sqs' => [
    'driver' => 'sqs', //mainly to show that I am using the correct driver
    'key' => env('SQS_KEY', 'your-public-key'),
    'secret' => env('SQS_SECRET', 'your-secret-key'),
    'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'),
    'queue' => env('SQS_QUEUE', 'your-queue-name'),
    'region' => env('SQS_REGION', 'us-east-1'),

For security, The actual value is hidden in .env. I then run:

composer require aws/aws-sdk-php ~3.0
php artisan config:cache
php artisan queue:listen

However, the process just sit there running, no response and no error message.

I want to ask:

  1. How do I know if the connection to the queue is correct?
  2. If the connection is correct, why there is no return from SQS? (I am sure there are already message inside SQS queue from the Amazon console)

Get this bounty!!!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.