src/Amqp/Silex/Provider/AmqpServiceProvider.php
public function register(Application $app)
    {
        if (empty($app[self::AMQP_CONNECTIONS])) {
            $app[self::AMQP_CONNECTIONS] = array(
                'default' => array(
                    'host' => 'localhost',
                    'port' => 5672,
                    'username' => 'guest',
                    'password' => 'guest',
                    'vhost' => '/',
                ),
            );
        }

        $app[self::AMQP_FACTORY] = $app->protect(function (
            $host = 'localhost',
            $port = 5672,
            $username = 'guest',
            $password = 'guest',
            $vhost = '/'
        ) use ($app) {
            return $app[self::AMQP]->createConnection($host, $port, $username, $password, $vhost);
        });

        $app[self::AMQP] = $app->share(function () use ($app) {
            return new AmqpConnectionProvider($app[self::AMQP_CONNECTIONS]);
        });
    }
public function register(Application $app)
    {
        if (empty($app[self::AMQP_CONNECTIONS])) {
            $app[self::AMQP_CONNECTIONS] = array(
                'default' => array(
                    'host' => 'localhost',
                    'port' => 5672,
                    'username' => 'guest',
                    'password' => 'guest',
                    'vhost' => '/',
                ),
            );
        }

        $app[self::AMQP_FACTORY] = $app->protect(function (
            $host = 'localhost',
            $port = 5672,
            $username = 'guest',
            $password = 'guest',
            $vhost = '/'
        ) use ($app) {
            return $app[self::AMQP]->createConnection($host, $port, $username, $password, $vhost);
        });

        $app[self::AMQP] = $app->share(function () use ($app) {
            return new AmqpConnectionProvider($app[self::AMQP_CONNECTIONS]);
        });
    }
Registers services on the given app.

This method should only be used to configure services and parameters.
It should not get services.

@param Application $app An Application instance