public function getChannel($connection)
    {
        if (isset($this->channels[$connection])) {
            return $this->channels[$connection];
        }

        if (!isset($this->connections[$connection])) {
            throw new \InvalidArgumentException(sprintf(
                'Unknown connection "%s". Available: [%s]',
                $connection,
                implode(', ', array_keys($this->connections))
            ));
        }

        if (!isset($this->channels[$connection])) {
            $this->channels[$connection] = array();
        }

        if (isset($this->connections[$connection]['ssl']) && $this->connections[$connection]['ssl']) {
            if (empty($this->connections[$connection]['ssl_options'])) {
                $ssl_opts = array(
                    'verify_peer' => true,
                );
            } else {
                $ssl_opts = array();
                foreach ($this->connections[$connection]['ssl_options'] as $key => $value) {
                    if (!empty($value)) {
                        $ssl_opts[$key] = $value;
                    }
                }
            }

            $conn = new AMQPSSLConnection(
                $this->connections[$connection]['host'],
                $this->connections[$connection]['port'],
                $this->connections[$connection]['login'],
                $this->connections[$connection]['password'],
                $this->connections[$connection]['vhost'],
                $ssl_opts
            );
        } else {
            $conn = new AMQPConnection(
                $this->connections[$connection]['host'],
                $this->connections[$connection]['port'],
                $this->connections[$connection]['login'],
                $this->connections[$connection]['password'],
                $this->connections[$connection]['vhost']
            );
        }

        $this->channels[$connection] = $conn->channel();

        return $this->channels[$connection];
    }