Teddy Codes
Teddy Codes

Reputation: 489

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. I set the HTTP Path to a file that could handle the requests. 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? 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!

When I check for a message with my php script that looks likes this:

$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. The message goes automatically to 'in flight'.

Thanks In Advance!

Upvotes: 2

Views: 2606

Answers (1)

Shibashis
Shibashis

Reputation: 8421

The messages are inflight because of the beanstalk worker environment configuration. The following documentation provides details on how to configure a beanstalk worker environment. http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/using-features-managing-env-tiers.html

Upvotes: 2

Related Questions