Skip to content

Exchanges

Managing RabbitMQ exchanges.

all() -> list[dict] async

List all exchanges in the cluster.

by_vhost(vhost: str) -> list[dict] async

List all exchanges in a specific virtual host.

delete(vhost: str, exchange: str, *, if_unused: bool = False) -> dict async

Delete an exchange.

Parameters:

Name Type Description Default
if_unused bool

If True, prevents deletion if the exchange has bindings.

False

destination_bindings(vhost: str, exchange: str) -> list[dict] async

List all bindings where this exchange is the destination.

detail(vhost: str, exchange: str) -> dict async

Get details of a specific exchange.

set(vhost: str, exchange: str, exchange_type: str, *, auto_delete: Optional[bool] = None, durable: Optional[bool] = None, internal: Optional[bool] = None, arguments: Optional[dict] = None) -> dict async

Create or update an exchange.

Parameters:

Name Type Description Default
exchange_type str

Type of exchange (e.g., 'direct', 'topic', 'fanout').

required
internal Optional[bool]

If True, exchange cannot be used directly by publishers.

None

source_bindings(vhost: str, exchange: str) -> list[dict] async

List all bindings where this exchange is the source.