Problem/Motivation

I need to get AWS SQS working and was unable to do it with the current 7.x-1.x branch.

Proposed resolution

As I was poking around and trying to debug I realized tons of AWS examples, videos, etc. all reference version 1 of the SDK, but the doc all point to version 2. I'm not 100% sure where CEikermann/AmazonSQS (included in the composer recipe) comes from. But I went ahead and swapped this out for AWS's official SDK and refactored AwsSqsQueue to use this for the plumbing and now everything seems to be working great.

(I was a little reluctant to abandon CEikermann/AmazonSQS without really knowing why this was chosen in the first place. But for my project and probably other enterprise Drupal sites, I suspect it's actually preferable to use AWS's official SDK simply because it's the official SDK.)

While I was refactoring things, I also found and fixed two bugs:

  • Before, if you enabled awsSqsQueue as your queue backend, unchecking this setting on the config page did not actually disable the SQS backend.
  • There are were some code comments that said SQS didn't support "releasing" a claim on an item in the queue. Turns out, SQS does support this. Their terminology is just different. They call this a "Visibility Timeout". So I went ahead and implemented this method.

Remaining tasks

  • Determine if maintainers are supportive of moving the project in this direction
  • Decide if this patch should be applied to the 1.x branch or a new 2.x branch (if people depend on third party libraries included in the 1.x branch, that's probably a good reason to put this in 2.x)
  • If this is going to get turned into a 2.x, it's probably worth back porting the fixes mentioned above to the 1.x branch (I'm happy to help pull those patches out)

User interface changes

  • Added more documentation on admin config page
  • Now the setting to turn SQS into the queue backend is a drop-down, not a checkbox
  • AWS regions are configurable on the admin config form
  • Added README file with setup instructions for newbies to AWS services and composer / composer_manager

API changes

Development and more granular patches (commit-by-commit) are posted in a pull request on GitHub:
https://github.com/bryanhirsch/aws_sqs/pull/1

Original report by bryanhirsch

Comments

bryanhirsch’s picture

Status: Active » Needs review
StatusFileSize
new27.18 KB
nick_vh’s picture

2080947-1--aws-sdk-php-v2.patch:58: trailing whitespace.

2080947-1--aws-sdk-php-v2.patch:74: trailing whitespace.

2080947-1--aws-sdk-php-v2.patch:279: trailing whitespace.
return new AwsSqsQueue($name);
2080947-1--aws-sdk-php-v2.patch:311: trailing whitespace.
* TODO Add link to documentation here. I think this info is out of date.
2080947-1--aws-sdk-php-v2.patch:624: trailing whitespace.
* Getters and setters
warning: squelched 3 whitespace errors
warning: 8 lines add whitespace errors.

Fixing those first.

nick_vh’s picture

StatusFileSize
new27.1 KB
nick_vh’s picture

Status: Needs review » Fixed

Committed.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.