PHP code example of slm / queue-sqs

1. Go to this page and download the library: Download slm/queue-sqs library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

slm / queue-sqs example snippets


$queue->push($job, array(
    'delay_seconds' => 20,
    'message_group_id' => 'foo',
    'enable_auto_deduplication' => false,
    'message_deduplication_id' => 'bar',
));


return [
    'aws' => [
        'credentials' => [
            'key' => 'ACCESS_KEY_GOES_HERE',
            'secret' => 'SECRET_KEY_GOES_HERE'
        ],
        'region' => 'us-east-1', ## or your region ##
        'Sqs' => [
            'version' => '2012-11-05' ## suggested to code this to a specific version of the SQS API.
        ]
    ]
];


return array(
    'slm_queue' => array(
        'queue_manager' => array(
            'factories' => array(
                'newsletter' => 'SlmQueueSqs\Factory\SqsQueueFactory'
            )
        )
    )
);


return array(
    'slm_queue' => array(
        'queues' => array(
            'worker-queue' => array(
                'queue_url' => 'http://sqs.amazonaws.com/my-queue'
            )
        )
    )
);