Faisal
Faisal

Reputation: 878

How would I run a queue of an Amazon SQS ? Is it a cron job?

I understand the basic of Amazon SQS. Yet i'm still confused on how it runs? Is it an infinite running function that polls messages and deal with it? how would I achieve that in php?

What I have in mind is a cron job that triggers the polling and process the messages. is my understanding right?

Upvotes: 2

Views: 2429

Answers (1)

ceejayoz
ceejayoz

Reputation: 179984

There's more than one answer to this.

Yes, you could have cron poll regularly for new queue items. You could have a daemon running indefinitely (likely monitored by something like supervisor) that continues to poll in a loop.

There's also SQS triggers, where a new SQS item can automatically initiate something. There are multiple options available: new queue items can make an SNS notification, which could trigger a HTTP POST to a URL. They can also trigger a Lambda function.

Upvotes: 1

Related Questions