'Get the exchange type.
Lookup and return the exchange type for an exchange specified by
name. Exchange types are expected to be \'direct\', \'topic\',
and \'fanout\', which correspond with exchange functionality as
specified in AMQP 0-10 and earlier. If the exchange cannot be
found, the default exchange type is returned.
:param exchange: The exchange to have its type lookup up.
:type exchange: str
:keyword default: The type of exchange to assume if the exchange does
not exist.
:type default: str
:return: The exchange type either \'direct\', \'topic\', or \'fanout\'.
:rtype: str'

def typeof(self, exchange, default=u'direct'):

    qpid_exchange = self._broker.getExchange(exchange)
    if qpid_exchange:
        qpid_exchange_attributes = qpid_exchange.getAttributes()
        return qpid_exchange_attributes[u'type']
    else:
        return default
