abacaphiliac/aws-sdk-php-claim-check

Claim Check enterprise integration pattern, implemented via AWS PHP SDK.

0.1.1 2016-04-14 15:39 UTC

README

Scrutinizer Code Quality Code Coverage Build Status

An implementation of the Claim Check Enterprise Integration Pattern, utilizing Amazon Web Services. AWS recommends usage of the Claim Check pattern on the SQS Compliance FAQ.

StoreInLibrary

This library provides extended SNS and SQS clients to "Check Luggage", uses S3 as the "Data Store", and uses the extended SQS client as the "Data Enricher".

This package aims to be a compatible port of Amazon's Extended Client Library. Messages stored via this PHP package should be able to be received by the Java package.

AWS Extended Client Library Compatibility

Similarities

  • Claim Check structure is identical, i.e. keys are s3BucketName and s3Key, meaning you can publish to SQS+S3 via this PHP lib and read via the AWS Extended Client Library java lib.

Differences

  • Messages published from SNS to SQS contain a nested Claim Check message structure, so the Java SDK is not be able to natively consume messages published to SNS (citation needed).
  • Usage of the pattern is not configurable by message size, nor can the pattern be disabled in this lib. Use the wrapped clients if you do not want to use Claim Check.
  • The AWS Extended Client Library will always delete the message from S3 when the message is deleted from SQS. This is not acceptable when messages are published to SNS and fanned-out to multiple subscribers (e.g. multiple SQS queues). This package allows you to disable deletion from S3 in the SQS extended client configuration.

Installation

composer require abacaphiliac/aws-php-claim-check-sdk

Contributing

composer install && vendor/bin/phing

This library attempts to comply with PSR-1, PSR-2, and PSR-4. If you notice compliance oversights, please send a patch via pull request.

Tasks

  • Add SQS check-in.
  • Add SQS check-out.
  • Add SNS check-in.
  • Use WireMock to stub API responses and add feature tests to CI.
  • Add async SQS check-in.
  • Add async SQS check-out.
  • Add async SNS check-in.