简体   繁体   English

带有Elastic Beanstalk的Amazon SQS服务

[英]Amazon SQS service with Elastic Beanstalk

I am fairly new to Amazon SQS and I am having a hard time understanding what is going on. 我对Amazon SQS相当陌生,并且很难理解正在发生的事情。 I set the HTTP Path to a file that could handle the requests. 我将HTTP路径设置为可以处理请求的文件。 but I am not sure if that was the correct thing to do. 但我不确定这是否正确。 What is the proper way? 正确的方法是什么? Why do the messages go directly to "In Flight"? 为什么消息直接转到“飞行中”? What happens when the message is sent to the HTTP path? 将消息发送到HTTP路径时会发生什么? I am using php for my application, so if someone could give me guidance on what I am doing wrong, then I would greatly appreciate it! 我正在为我的应用程序使用php,所以如果有人可以给我有关我做错了什么的指导,那么我将不胜感激!

When I check for a message with my php script that looks likes this: 当我用我的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;

I always get 'No Message' in return when running the program. 运行该程序时,我总是得到“无消息”作为回报。 I inserted a message via the AWS SQS console and I am unable to receive it. 我通过AWS SQS控制台插入了一条消息,但无法接收到它。 The message goes automatically to 'in flight'. 该消息会自动转到“飞行中”。

Thanks In Advance! 提前致谢!

The messages are inflight because of the beanstalk worker environment configuration. 由于beantalk worker环境配置,消息正在运行。 The following documentation provides details on how to configure a beanstalk worker environment. 以下文档提供了有关如何配置beantalk worker环境的详细信息。 http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/using-features-managing-env-tiers.html 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