Search by

envoylope / amqp-sqs-driver

asmblah

AWS SQS driver for PHP AMQP-Compat

Package info

github.com/envoylope/amqp-sqs-driver

pkg:composer/envoylope/amqp-sqs-driver

Statistics

Installs: 2

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v0.1.0 2026-10-15 04:11 UTC

This package is auto-updated.

Last update: 2026-10-15 04:15:24 UTC


README

Build Status

AWS SQS driver for PHP AMQP-Compat.

Emulates AMQP concepts such as exchange routing on top of SQS.

Usage

Install via Composer:

$ composer require envoylope/amqp-sqs-driver

Then configure as the driver for PHP AMQP-Compat, e.g. if using Nytris platform:

nytris.config.php

...
use Envoylope\Amqp\Driver\Sqs\SqsDriver;
...
$bootConfig->installPackage(new AmqpCompatPackage(
    ...
    driver: new SqsDriver(setup: ...)
));
...

Setup examples:

No warm-up needed when the topology cache is always populated:

$bootConfig->installPackage(new AmqpCompatPackage(
    driver: new SqsDriver(
        new ExistingSetup(
            new SqsClient([...]),
            new CacheBackedTopologyStorage(cache: new ArrayAdapter())
        )
    )
));

Usage with a warm-up callback (required when using a volatile cache):

$bootConfig->installPackage(new AmqpCompatPackage(
    driver: new SqsDriver(
        new ExistingSetup(
            new SqsClient([...]),
            new CacheBackedTopologyStorage(
                cache: new ApcuAdapter(),
                warmUp: function () use ($channel): void {
                    $exchange = new AMQPExchange($channel);
                    $exchange->setName('my-exchange');
                    $exchange->setType(AMQP_EX_TYPE_DIRECT);
                    $exchange->setFlags(AMQP_DURABLE);
                    $exchange->declareExchange();

                    $queue = new AMQPQueue($channel);
                    $queue->setName('my-queue');
                    $queue->setFlags(AMQP_DURABLE);
                    $queue->declareQueue();
                    $queue->bind('my-exchange', 'my-routing-key');
                }
            )
        )
    )
));