seaworthy.containers.rabbitmq¶
RabbitMQ container definition.
-
class
RabbitMQContainer
(name='rabbitmq', image='rabbitmq:alpine', wait_patterns=('Server startup complete', ), vhost='/vhost', user='user', password='password', **kwargs)[source]¶ RabbitMQ container definition.
Todo
Write more docs.
-
base_kwargs
()[source]¶ Add a
tmpfs
entry for/var/lib/rabbitmq
to avoid unnecessary disk I/O andenvironment
entries for the configured vhost and user creds.
-
exec_rabbitmqctl
(command, args=[], rabbitmqctl_opts=['-q'])[source]¶ Execute a
rabbitmqctl
command inside a running container.Parameters: - command – the command to run
- args – a list of args for the command
- rabbitmqctl_opts – a list of extra options to pass to
rabbitmqctl
Returns: a tuple of the command exit code and output
-
exec_rabbitmqctl_list
(resources, args=[], rabbitmq_opts=['-q', '--no-table-headers'])[source]¶ Execute a
rabbitmqctl
command to list the given resources.Parameters: - resources – the resources to list, e.g.
'vhosts'
- args – a list of args for the command
- rabbitmqctl_opts – a list of extra options to pass to
rabbitmqctl
Returns: a tuple of the command exit code and output
- resources – the resources to list, e.g.
-
list_queues
()[source]¶ Run the
list_queues
command (for the default vhost) and return a list of tuples describing the queues.Returns: A list of 2-element tuples. The first element is the queue name, the second is the current queue size.
-