Skip to content

Exchange

faststream.specification.schema.bindings.amqp.Exchange dataclass #

Exchange(type, name=None, durable=None, auto_delete=None)

type instance-attribute #

type

name class-attribute instance-attribute #

name = None

durable class-attribute instance-attribute #

durable = None

auto_delete class-attribute instance-attribute #

auto_delete = None

is_respect_routing_key property #

is_respect_routing_key

Is exchange respects routing key or not.

from_exchange classmethod #

from_exchange(exchange)
Source code in faststream/specification/schema/bindings/amqp.py
@classmethod
def from_exchange(cls, exchange: "RabbitExchange") -> "Exchange":
    if not exchange.name:
        return cls(type="default")
    return cls(
        type=exchange.type.value,
        name=exchange.name,
        durable=exchange.durable,
        auto_delete=exchange.auto_delete,
    )