kombu.transport.virtual.exchange

Implementations of the standard exchanges defined by the AMQ protocol (excluding the headers exchange).

copyright:
  1. 2009 - 2011 by Ask Solem.
license:

BSD, see LICENSE for more details.

Direct

class kombu.transport.virtual.exchange.DirectExchange(channel)

The direct exchange routes based on exact routing keys.

lookup(table, exchange, routing_key, default)

Topic

class kombu.transport.virtual.exchange.TopicExchange(channel)

The topic exchanges routes based on words separated by dots, and wildcard characters * (any single word), and # (one or more words).

key_to_pattern(rkey)

Get the corresponding regex for any routing key.

lookup(table, exchange, routing_key, default)
prepare_bind(queue, exchange, routing_key, arguments)
wildcards

map of wildcard to regex conversions

Fanout

class kombu.transport.virtual.exchange.FanoutExchange(channel)

The fanout exchange implements broadcast messaging by delivering copies of all messages to all queues bound the the exchange.

To support fanout the virtual channel needs to store the table as shared state. This requires that the Channel.supports_fanout attribute is set to true, and the Channel._queue_bind and Channel.get_table methods are implemented. See the redis backend for an example implementation of these methods.

lookup(table, exchange, routing_key, default)

Interface

class kombu.transport.virtual.exchange.ExchangeType(channel)

Implements the specifics for an exchange type.

Parameters:channel – AMQ Channel
equivalent(prev, exchange, type, durable, auto_delete, arguments)

Returns true if prev and `exchange is equivalent.

lookup(table, exchange, routing_key, default)

Lookup all queues matching routing_key in exchange.

Returns:default if no queues matched.
prepare_bind(queue, exchange, routing_key, arguments)
Returns:(routing_key, regex, queue) tuple to store

for bindings to this exchange.

Table Of Contents

Previous topic

kombu.transport.virtual

Next topic

kombu.transport.virtual.scheduling

This Page