ocrd_network.rabbitmq_utils.connector module

The source code in this file is adapted by reusing some part of the source code from the official RabbitMQ documentation.

class ocrd_network.rabbitmq_utils.connector.RMQConnector(host: str = 'localhost', port: int = 5672, vhost: str = '/')[source]

Bases: object

close_connection(reply_code: int = 200, reply_text: str = 'Normal shutdown')[source]
static declare_and_bind_defaults(connection: BlockingConnection, channel: BlockingChannel) None[source]
static open_blocking_connection(credentials: PlainCredentials, host: str = 'localhost', port: int = 5672, vhost: str = '/') BlockingConnection[source]
static open_blocking_channel(connection: BlockingConnection) BlockingChannel | None[source]
static exchange_bind(channel: BlockingChannel, destination_exchange: str, source_exchange: str, routing_key: str, arguments: Any | None = None) None[source]
static exchange_declare(channel: BlockingChannel, exchange_name: str, exchange_type: str, passive: bool = False, durable: bool = False, auto_delete: bool = False, internal: bool = False, arguments: Any | None = None) None[source]
static exchange_delete(channel: BlockingChannel, exchange_name: str, if_unused: bool = False) None[source]
static exchange_unbind(channel: BlockingChannel, destination_exchange: str, source_exchange: str, routing_key: str, arguments: Any | None = None) None[source]
static queue_bind(channel: BlockingChannel, queue_name: str, exchange_name: str, routing_key: str, arguments: Any | None = None) None[source]
static queue_declare(channel: BlockingChannel, queue_name: str, passive: bool = False, durable: bool = False, exclusive: bool = False, auto_delete: bool = False, arguments: Any | None = None) None[source]
static queue_delete(channel: BlockingChannel, queue_name: str, if_unused: bool = False, if_empty: bool = False) None[source]
static queue_purge(channel: BlockingChannel, queue_name: str) None[source]
static queue_unbind(channel: BlockingChannel, queue_name: str, exchange_name: str, routing_key: str, arguments: Any | None = None) None[source]
create_queue(queue_name: str, exchange_name: str | None = 'ocrd-network-default', exchange_type: str | None = 'direct', passive: bool = False) None[source]
static set_qos(channel: BlockingChannel, prefetch_size: int = 0, prefetch_count: int = 1, global_qos: bool = False) None[source]
static confirm_delivery(channel: BlockingChannel) None[source]
static basic_publish(channel: BlockingChannel, exchange_name: str, routing_key: str, message_body: bytes, properties: BasicProperties) None[source]