public function setType($exchange_type) {

        if(!in_array($exchange_type, array(AMQP_EX_TYPE_DIRECT, AMQP_EX_TYPE_FANOUT, AMQP_EX_TYPE_HEADERS, AMQP_EX_TYPE_TOPIC)))
            return false;

        $this->type = $exchange_type;
        return true;
    }