This document is for Celery's development version, which can be significantly different from previous releases. Get old docs here: 2.5.

celery.app.amqp

AMQ related functionality.

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

BSD, see LICENSE for more details.

AMQP

class celery.app.amqp.AMQP(app)
BrokerConnection

Broker connection class used. Default is kombu.connection.BrokerConnection.

Consumer

Base Consumer class used. Default is kombu.compat.Consumer.

queues

All currently defined task queues. (A Queues instance).

Queues(queues, create_missing=None)

Create new Queues instance, using queue defaults from the current configuration.

Router(queues=None, create_missing=None)

Returns the current task router.

TaskConsumer

Returns consumer for a single task queue.

TaskProducer

Returns publisher used to send tasks.

You should use app.send_task instead.

flush_routes()
default_queue
default_exchange
publisher_pool
router
routes

Queues

class celery.app.amqp.Queues(queues, default_exchange=None, create_missing=True)

Queue name⇒ declaration mapping.

Parameters:
  • queues – Initial list/tuple or dict of queues.
  • create_missing – By default any unknown queues will be added automatically, but if disabled the occurrence of unknown queues in wanted will raise KeyError.
add(queue, **kwargs)

Add new queue.

Parameters:
  • queue – Name of the queue.
  • exchange – Name of the exchange.
  • routing_key – Binding key.
  • exchange_type – Type of exchange.
  • **options – Additional declaration options.
format(indent=0, indent_first=True)

Format routing table into string for log dumps.

select_subset(wanted)

Sets consume_from by selecting a subset of the currently defined queues.

Parameters:wanted – List of wanted queue names.
new_missing(name)
consume_from

TaskPublisher

celery.app.amqp.TaskPublisher

alias of TaskProducer

Previous topic

celery.app.task

Next topic

celery.app.defaults

This Page