我们正在将现有应用程序从 Linode 迁移到 AWS。在 Linode 上,我们使用 beanstalkd 作为我们的消息队列,现在我们想尝试 SQS。我们使用 2 个队列:默认队列和高队列。我们对 beanstalk 的配置设置如下:
'connections' => [
'beanstalkd' => [
'driver' => 'beanstalkd',
'host' => env('BEANSTALKD_HOST', 'localhost'),
'queue' => 'default',
'retry_after' => 86400,
],
'high' => [
'driver' => 'beanstalkd',
'host' => env('BEANSTALKD_HOST', 'localhost'),
'queue' => 'high',
'retry_after' => 86400,
],
],
我现在正在尝试在 AWS 上做类似的事情。配置现在如下所示:
'connections' => [
'sqs' => [
'driver' => 'sqs',
'key' => env('AWS_KEY'),
'secret' => env('AWS_SECRET'),
'prefix' => env('AWS_SQS_URL'),
'queue' => 'default',
'region' => env('AWS_REGION'),
],
'high' => [
'driver' => 'sqs',
'key' => env('AWS_KEY'),
'secret' => env('AWS_SECRET'),
'prefix' => env('AWS_SQS_URL'),
'queue' => 'high',
'region' => env('AWS_REGION'),
],
],
我在 AWS 上创建了一个名为"dev"的队列,我有这个 URL:https://sqs.eu-west-2.amazonaws.com/ACCOUNT-ID/dev 我得到的错误是这样的:
Error executing "ReceiveMessage" on "https://sqs.eu-west-2.amazonaws.com/ACCOUNT-ID/dev/high"; AWS HTTP error: Client error: `POST https://sqs.eu-west-2.amazonaws.com/ACCOUNT-ID/dev/high` resulted in a `400 Bad Request` response:
<?xml version="1.0"?><ErrorResponse xmlns="http://queue.amazonaws.com/doc/2012-11-05/"><Error><Type>Sender</Type><Code>A (truncated...)
AWS.SimpleQueueService.NonExistentQueue (client): The specified queue does not exist for this wsdl version. - <?xml version="1.0"?><ErrorResponse xmlns="http://queue.amazonaws.com/doc/2012-11-05/"><Error><Type>Sender</Type><Code>AWS.SimpleQueueService.NonExistentQueue</Code><Message>The specified queue does not exist for this wsdl version.</Message><Detail/></Error><RequestId>REQUEST-ID</RequestId></ErrorResponse>
它说"指定的队列不存在"。我应该在 AWS 中创建不同的队列还是我的配置有问题?
管理引擎配置:
[program:worker]
command=php /home/dev/default/current/artisan queue:work sqs --sleep=0 --daemon --quiet --timeout=0 --delay=3 --tries=3 --env=development --queue="high,default"
process_name=%(program_name)s_%(process_num)02d
autostart=true
autorestart=true
stopasgroup=true
killasgroup=true
user=dev
numprocs=8
stdout_logfile=
抱歉回复晚了。我在谷歌上搜索了同样的问题,我找到了这个问题。
网址应为https://sqs.eu-west-2.amazonaws.com/your-account-id
.网址后没有queue name
。因此,您需要从URL中删除dev
。
谢谢