/**
* @param string $protocol
* @param string $encoding
* @param bool $synchronous
* @param array $endpoint
*/
public function __construct($protocol, $encoding, $synchronous = false, array $endpoint = [])
{
parent::__construct($protocol, $encoding, $synchronous, $endpoint);
list($exchangeName, $routingKey) = array_values($this->endpoint);
$credentials = array_filter($this->endpoint);
$this->connection = new \AMQPConnection($credentials);
$this->connection->connect();
$this->channel = new \AMQPChannel($this->connection);
$this->exchange = new \AMQPExchange($this->channel);
$this->exchange->setName($exchangeName);
}