Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

RabbitMQ (AMQP)

Schemes: amqp://, amqps://, rabbitmq://, rabbitmqs://

Query parameters recognised as config fields for this connector. The object-typed tls is set with a JSON literal, e.g. ?tls={...}. Any other ?key=value pair is passed through unchanged as a driver option on the connection URL.

NameTypeRequiredDefaultDescription
delayed_ackbooleannofalse(Publisher only) If true, do not wait for an acknowledgement when sending to broker. Defaults to false.
exchangestringno—The exchange to publish to or bind the queue to.
no_declare_queuebooleannofalse(Publisher only) If true, do not attempt to declare the queue. Assumes the queue already exists. Defaults to false.
no_persistencebooleannofalseIf true, declare queues as non-durable (transient). Defaults to false. Affects both Consumer (queue durability) and Publisher (message persistence).
passwordstringno—Optional password for authentication.
prefetch_countintegerno—(Consumer only) Number of messages to prefetch. Defaults to 100.
queuestringno—The AMQP queue name.
source_metadatabooleannofalse(Consumer only) Include authoritative mqb.src.amqp_* source positions. Defaults to false.
subscribe_modebooleannofalse(Consumer only) If true, act as a Subscriber (fan-out). Defaults to false.
tlsobjectnosee belowTLS configuration.
urlstringyes—AMQP connection URI. The lapin client connects to a single host specified in the URI. If it contains userinfo, it will be treated as a secret. For high availability, provide the address of a load balancer or use DNS resolution that points to multiple brokers. Example: “amqp://localhost:5672/vhost”.
usernamestringno—Optional username for authentication.

Struct-typed fields

tls

TLS configuration for secure connections.

Configures Transport Layer Security (TLS/SSL) for encrypted communication. Supports both client certificate (mutual TLS) and server certificate validation.

Examples

use mq_bridge::models::TlsConfig;

let tls = TlsConfig {
    required: true,
    ca_file: Some("/path/to/ca.pem".to_string()),
    cert_file: Some("/path/to/cert.pem".to_string()),
    key_file: Some("/path/to/key.pem".to_string()),
    ..Default::default()
};
NameTypeRequiredDefaultDescription
accept_invalid_certsbooleannofalseIf true, disable server certificate verification (insecure).
ca_filestringno—Path to the CA certificate file.
cert_filestringno—Path to the client certificate file (PEM).
cert_passwordstringno—Password for the private key (if encrypted).
key_filestringno—Path to the client private key file (PEM).
requiredbooleannofalseIf true, enable TLS/SSL.