/**
* @inheritdoc
*/
public function init()
{
if (empty($this->user)) {
throw new \Exception("Parameter 'user' was not set for AMQP connection.");
}
if (empty(self::$ampqConnection)) {
self::$ampqConnection = new \AMQPConnection();
self::$ampqConnection->setHost($this->host);
self::$ampqConnection->setPort($this->port);
self::$ampqConnection->setLogin($this->user);
self::$ampqConnection->setPassword($this->password);
self::$ampqConnection->setVhost($this->vhost);
self::$ampqConnection->connect();
}
}