baseplate.context.kombu¶
Configuration Parsing¶
-
baseplate.context.kombu.connection_from_config(app_config, prefix, **kwargs)¶ Make a Connection from a configuration dictionary.
The keys useful to
connection_from_config()should be prefixed, e.g.amqp.hostnameetc. Theprefixargument specifies the prefix used to filter keys. Each key is mapped to a corresponding keyword argument on theConnectionconstructor. Any keyword arguments given to this function will be passed through to theConnectionconstructor. Keyword arguments take precedence over the configuration file.Supported keys:
hostnamevirtual_host
-
baseplate.context.kombu.exchange_from_config(app_config, prefix, **kwargs)¶ Make an Exchange from a configuration dictionary.
The keys useful to
exchange_from_config()should be prefixed, e.g.amqp.exchange_nameetc. Theprefixargument specifies the prefix used to filter keys. Each key is mapped to a corresponding keyword argument on theExchangeconstructor. Any keyword arguments given to this function will be passed through to theExchangeconstructor. Keyword arguments take precedence over the configuration file.Supported keys:
exchange_nameexchange_type
Classes¶
-
class
baseplate.context.kombu.KombuProducerContextFactory(connection, exchange, max_connections=None)¶ KombuProducer context factory.
This factory will attach a proxy object which acts like a
kombu.Producerto an attribute on the context object. Thepublish()method will automatically record diagnostic information.Parameters: - connection (kombu.connection.Connection) – A configured connection object.
- exchange (kombu.Exchange) – A configured exchange object
- max_connections (int) – The maximum number of connections.
-
class
baseplate.context.kombu.KombuProducer(name, span, connection, exchange, producers)¶ -
publish(body, routing_key=None, **kwargs)¶ Publish a message to the routing_key.
Parameters: See Kombu Documentation for other arguments.
-