Reputation: 5030
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)
{
var_dump($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:
Upvotes: 5
Views: 2448
Reputation: 37480
I'm not sure why you are using a queue rather than a simple https endpoint. That removes a lot of complexity and doesn't require polling.
There is a simple php example that shows what is needed.
The biggest gotcha is that you need to be able to confirm the SNS subscription before SNS will start sending POST requests to your endpoint.
Upvotes: 0