public function declareQueue() {

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

        try {
            list($this->name, $num_messages) = $this->channel->_getChannel()->queue_declare($this->name, $passive, $durable, $exclusive, $auto_delete, $nowait = false, $this->arguments);
        } catch (AMQPRuntimeException $e) {
            throw new AMQPConnectionException($e->getMessage(), $e->getCode(), $e->getPrevious());
        } catch (Exception $e) {
            return 0;
        }

        return $num_messages;
    }