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.hostname
etc. Theprefix
argument specifies the prefix used to filter keys. Each key is mapped to a corresponding keyword argument on theConnection
constructor. Any keyword arguments given to this function will be passed through to theConnection
constructor. Keyword arguments take precedence over the configuration file.Supported keys:
hostname
virtual_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_name
etc. Theprefix
argument specifies the prefix used to filter keys. Each key is mapped to a corresponding keyword argument on theExchange
constructor. Any keyword arguments given to this function will be passed through to theExchange
constructor. Keyword arguments take precedence over the configuration file.Supported keys:
exchange_name
exchange_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.Producer
to 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.
-