Search by

ebichan / silex-amqp-provider

Ebichan

AMQP service provider for the Silex framework.

This package's canonical repository appears to be gone and the package has been frozen as a result. Email us for help if needed.

Package info

github.com/jonathan-sousa/silex-amqp-provider

pkg:composer/ebichan/silex-amqp-provider

Statistics

Installs: 67 201

Dependents: 0

Suggesters: 0

Stars: 3

Open Issues: 2

1.0.1 2016-06-06 12:00 UTC

This package is not auto-updated.

Last update: 2025-08-22 07:27:01 UTC


README

Amqp service provider for the Silex framework.

This repository is strongly inspired by the work of Vitaliy Chesnokov on his Mongo Silex Provider.

Install via composer

Add in your composer.json the require entry for this library.

{
    "require": {
        "ebichan/silex-amqp-provider": "dev-master"
    }
}

and run composer install (or update) to download all files.

Usage

Service registration

$app->register(new AmqpServiceProvider, array(
    'amqp.connections' => array(
        'default' => array(
            'host' => 'localhost',
            'port' => 5672,
            'username' => 'guest',
            'password' => 'guest',
            'vhost'    => '/'
        )
    ),
));

Connections retrieving

$connections = $app['amqp'];
$defaultConnection = $connections['default']; 

Creating amqp connection via factory

$amqpFactory = $app['amqp.factory'];
$customConnection = $amqpFactory('localhost', 5672, 'guest', 'guest', '/');