public function delete($exchangeName = null, $flags = AMQP_NOPARAM) {

        $if_unused = boolval($flags & AMQP_IFUNUSED);

        if($exchangeName === null)
            $exchangeName = $this->name;

        try {
            $this->channel->_getChannel()->exchange_delete($exchangeName, $if_unused);
        } 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;

    }