public function declareExchange() {

        $durable = boolval($this->flags & AMQP_DURABLE);
        $passive = boolval($this->flags & AMQP_PASSIVE);
        $auto_delete = boolval($this->flags & AMQP_AUTODELETE);

        try {
            $this->channel->_getChannel()->exchange_declare($this->name, $this->type, $passive, $durable, $auto_delete);
        } catch (AMQPRuntimeException $e) {
            throw new AMQPConnectionException($e->getMessage(), $e->getCode(), $e->getPrevious());
        } catch (Exception $e) {
            throw new AMQPExchangeException($e->getMessage(), $e->getCode(), $e->getPrevious());
        }

        return true;
    }