PHP code example of ebichan / silex-amqp-provider

1. Go to this page and download the library: Download ebichan/silex-amqp-provider 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/ */

    

ebichan / silex-amqp-provider example snippets


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

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

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