class, stderr=None, no_color=False, force_color=False)[source]

Starting a Tornado-powered Django AMQP 0-9-1 consumer. Implements consume command as a management command for django application. The new command can be called using python consume <arguments>. Arguments:

  • --queue - the AMQP 0-9-1 queue to consume from

  • --exchange - the AMQP 0-9-1 exchange to declare

  • --amqp-port - the message broker connection port

  • --amqp-host - the host address of the message broker

  • --amqp-vhost - the virtual host of the message broker to use with this consumer

  • --handler - the Hurricane AMQP handler class (dotted path)

  • --startup-probe - the exposed path (default is /startup) for probes to check startup

  • --readiness-probe - the exposed path (default is /ready) for probes to check readiness

  • --liveness-probe - the exposed path (default is /alive) for probes to check liveness

  • --probe-port - the port for Tornado probe route to listen on

  • --req-queue-len - threshold of length of queue of request, which is considered for readiness probe

  • --no-probe - disable probe endpoint

  • --no-metrics - disable metrics collection

  • --autoreload - reload code on change

  • --debug - set Tornado’s Debug flag

  • --reconnect - try to reconnect this client automatically as the broker is available again

  • --max-lifetime- If specified, maximum requests after which pod is restarted


Defines arguments, that can be accepted with consume command.

handle(*args, **options)[source]

Defines functionalities for different arguments. After all arguments were processed, it starts the async event loop.