easybib/silex-qpush-provider

Silex service provider for uecode/qpush-bundle

1.1.1 2016-09-30 15:29 UTC

This package is not auto-updated.

Last update: 2021-09-18 02:53:47 UTC


README

Silex service provider for uecode/qpush-bundle

Setup

$app->register(new \EasyBib\QPushServiceProvider(), [
    'uecode_qpush.queue_suffix' => 'suffix', // Allows to configure suffix (e.g. environment name)
    'uecode_qpush.config' => [
        'cache' => 'my.cache.service',
        'providers' => [
            'aws' => [
                'driver' => 'aws',
                'key' => 'key',
                'secret' => 'secret',
                'region' => 'us-east-1',
            ],
        ],
        'queues' => [
            'my_queue' => [
                'provider' => 'aws',
                'callback' => [
                   'service:method',
                ],
                'options' => [
                    'logging_enabled' => true,
                    'queue_name' => 'my_queue',
                    'push_notifications' => false,
                    'message_delay' =>  0,
                    'message_timeout' => 30,
                    'message_expiration' => 604800,
                    'messages_to_receive' => 1,
                    'receive_wait_time' => 3,
                ],
            ],
        ],
    ],
]);

Local FakeSQS setup

For local setup/testing you might want to use Fake SQS as Amazon SQS replacement.

$app->register(new \EasyBib\QPushServiceProvider(), [
    'uecode_qpush.config' => [
        'providers' => [
            'fakesqs' => [
                'driver' => 'aws',
                'key' => 'fake key',
                'secret' => 'fake secret',
                'region' => 'us-east-1', // Needs to be set but won't be used
                'endpoint' => "http://localhost:4568",
            ],
        ],
    ],
]);