繁体   English   中英

带有Elastic Beanstalk的Amazon SQS服务

[英]Amazon SQS service with Elastic Beanstalk

我对Amazon SQS相当陌生,并且很难理解正在发生的事情。 我将HTTP路径设置为可以处理请求的文件。 但我不确定这是否正确。 正确的方法是什么? 为什么消息直接转到“飞行中”? 将消息发送到HTTP路径时会发生什么? 我正在为我的应用程序使用php,所以如果有人可以给我有关我做错了什么的指导,那么我将不胜感激!

当我用我的php脚本检查消息时,看起来像这样:

$sqs_client = new SqsClient($sqs_credentials);

// Get the queue URL from the queue name.
$result = $sqs_client->getQueueUrl(array('QueueName' => "NormalPoll"));
$queue_url = $result->get('QueueUrl');

// Receive a message from the queue
$result = $sqs_client->receiveMessage(array(
    'QueueUrl' => $queue_url
));

if ($result['Messages'] == null) {
    die('No Message');
}

// Get the message information
$result_message = array_pop($result['Messages']);
$body = $result_message['Body'];
print $body;

运行该程序时,我总是得到“无消息”作为回报。 我通过AWS SQS控制台插入了一条消息,但无法接收到它。 该消息会自动转到“飞行中”。

提前致谢!

由于beantalk worker环境配置,消息正在运行。 以下文档提供了有关如何配置beantalk worker环境的详细信息。 http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/using-features-managing-env-tiers.html

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM