Recommend this page to a friend! |
![]() |
Info | Documentation | ![]() |
![]() |
![]() |
Reputation | Support forum | Blog | Links |
Ratings | Unique User Downloads | Download Rankings | ||||
Not yet rated by the users | Total: 62 | All time: 10,469 This week: 455![]() |
Version | License | PHP version | Categories | |||
aws-sqs-wrapper 1.0 | BSD License | 5 | PHP 5, Tools, Web services |
Description | Author | ||||||||||||||
This package can publish and subscribe message queues using AWS SQS. Innovation Award |
|
PHP library for simplified SQS queue messages processing.
composer require ndthuan/aws-sqs-wrapper
use Aws\Sqs\SqsClient;
use Ndthuan\AwsSqsWrapper\Publishing\Publisher;
use Ndthuan\AwsSqsWrapper\Queue\Connector;
$queueUrl = ''; // get this from your own AWS SQS setup
// creating a publisher
$sqsClient = new SqsClient(...);
$queueConnector = new Connector($sqsClient, $queueUrl);
$publisher = new Publisher($queueConnector);
// send a string message
$publisher->publishString('My message body');
// or send a json serializable object/array
$myMessage = [
'my' => 'data',
];
$publisher->publishJsonSerializable($myMessage);
use Aws\Sqs\SqsClient;
use Ndthuan\AwsSqsWrapper\Queue\Connector;
use Ndthuan\AwsSqsWrapper\Queue\ReceivedMessage;
use Ndthuan\AwsSqsWrapper\Queue\ResultMetadata;
use Ndthuan\AwsSqsWrapper\Subscribing\DelegatorSubscriber;
// defining a message processor
class MyMessageProcessor implements MessageProcessorInterface
{
/
* @inheritdoc
*/
public function processMessage(ReceivedMessage $message, ResultMetadata $resultMetadata)
{
// your processing logic
}
}
$queueUrl = ''; // get this from your own AWS SQS setup
// creating a subscriber
$sqsClient = new SqsClient(...);
$queueConnector = new Connector($sqsClient, $queueUrl);
$subscriber = new DelegatorSubscriber(new MyMessageProcessor(), $queueConnector);
// run the subscriber
$subscriber->pullAndProcessMessages();
A message processor may throw exceptions or errors. Subscriber will react differently depending on exception type:
![]() |
File | Role | Description | ||
---|---|---|---|---|
![]() |
||||
![]() |
||||
![]() ![]() |
Data | Auxiliary data | ||
![]() ![]() |
Data | Auxiliary data | ||
![]() ![]() |
Data | Auxiliary data | ||
![]() ![]() |
Data | Auxiliary data | ||
![]() ![]() |
Lic. | License text | ||
![]() ![]() |
Data | Auxiliary data | ||
![]() ![]() |
Doc. | Documentation | ||
![]() ![]() |
Data | Auxiliary data | ||
![]() ![]() |
Data | Auxiliary data | ||
![]() ![]() |
Data | Auxiliary data |
![]() |
/ | src |
File | Role | Description | ||
---|---|---|---|---|
![]() |
||||
![]() |
||||
![]() |
![]() |
/ | src | / | Queue |
File | Role | Description |
---|---|---|
![]() |
Class | Class source |
![]() |
Class | Class source |
![]() |
Class | Class source |
![]() |
Class | Class source |
![]() |
Class | Class source |
![]() |
Class | Class source |
![]() |
/ | src | / | Subscribing |
File | Role | Description | ||
---|---|---|---|---|
![]() |
||||
![]() |
||||
![]() |
Class | Class source | ||
![]() |
Class | Class source | ||
![]() |
Class | Class source | ||
![]() |
Class | Class source | ||
![]() |
Class | Class source | ||
![]() |
Class | Class source |
![]() |
/ | src | / | Subscribing | / | Callbacks |
File | Role | Description |
---|---|---|
![]() |
Class | Class source |
![]() |
Class | Class source |
![]() |
Class | Class source |
![]() |
/ | src | / | Subscribing | / | Exception |
File | Role | Description |
---|---|---|
![]() |
Class | Class source |
![]() |
Class | Class source |
![]() |
Class | Class source |
![]() |
/ | tests |
File | Role | Description | ||
---|---|---|---|---|
![]() |
||||
![]() |
||||
![]() ![]() |
Aux. | Auxiliary script |
![]() |
/ | tests | / | unit |
File | Role | Description | ||
---|---|---|---|---|
![]() |
||||
![]() |
||||
![]() |
![]() |
/ | tests | / | unit | / | Queue |
File | Role | Description |
---|---|---|
![]() |
Class | Class source |
![]() |
/ | tests | / | unit | / | Subscribing |
File | Role | Description | ||
---|---|---|---|---|
![]() |
||||
![]() |
Class | Class source |
![]() |
/ | tests | / | unit | / | Subscribing | / | Callbacks |
File | Role | Description |
---|---|---|
![]() |
Class | Class source |
The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page. |
![]() |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
100% |
|
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.