Reference: Exchange CRD¶
An Exchange declares an exchange in a virtual host of your RabbitMQ cluster.
Publishers send messages to an exchange, and the exchange routes them to queues
or other exchanges according to its type and its bindings. You connect an
exchange to a queue with a Binding.
apiVersion:rabbitmq.com/v1beta1kind:Exchange- Scope: Namespaced
This page documents the RabbitMQ Messaging Topology Operator v1.20.6.
Example¶
apiVersion: rabbitmq.com/v1beta1
kind: Exchange
metadata:
name: my-app-orders-exchange
namespace: your-application-namespace
spec:
# The name of the exchange inside RabbitMQ
name: orders
vhost: my-app-vhost
type: topic
durable: true
autoDelete: false
rabbitmqClusterReference:
name: my-rabbitmq-cluster
Specification (spec)¶
| Field | Type | Description |
|---|---|---|
name |
string |
Required. The name of the exchange in RabbitMQ. You cannot change this field after creation. |
vhost |
string |
Optional. The RabbitMQ name of the virtual host. Default: /. You cannot change this field after creation. |
rabbitmqClusterReference |
object |
Required. The RabbitMQ cluster to create the exchange in. You cannot change this field after creation. See spec.rabbitmqClusterReference. |
type |
string |
Optional. The exchange type. RabbitMQ provides direct, fanout, topic and headers. Plugins can add more types. Default: direct. You cannot change this field after creation. |
durable |
boolean |
Optional. When true, the exchange survives a broker restart. Default: false. You cannot change this field after creation. |
autoDelete |
boolean |
Optional. When true, RabbitMQ deletes the exchange when its last binding is removed. Default: false. You cannot change this field after creation. |
arguments |
object |
Optional. Optional exchange arguments as key-value pairs, for example alternate-exchange: unrouted. See RabbitMQ exchanges. |
spec.rabbitmqClusterReference¶
Identifies the RabbitMQ cluster. Set either name or connectionSecret, but
not both.
| Field | Type | Description |
|---|---|---|
name |
string |
Optional. The name of the RabbitmqCluster resource. Set this field or connectionSecret. |
namespace |
string |
Optional. The namespace of the RabbitmqCluster. Defaults to the namespace of the Exchange. A cluster in another namespace accepts the reference only if its rabbitmq.com/topology-allowed-namespaces annotation lists your namespace. |
connectionSecret |
object |
Optional. A reference (name) to a Secret with the keys uri, username and password for the management API of a RabbitMQ cluster that the RabbitMQ Cluster Operator does not manage. The Secret must have the label rabbitmq.com/topology-operator: "true". Set this field or name. |
Status (status)¶
| Field | Type | Description |
|---|---|---|
conditions |
[]object |
The Ready condition is True with reason SuccessfulCreateOrUpdate when the exchange exists in RabbitMQ, and False with reason FailedCreateOrUpdate and an error message otherwise. |
observedGeneration |
integer |
The most recent metadata.generation that the operator reconciled. |
Platform Notes¶
- We provision and manage the
RabbitmqClusterresource in your namespace and give you its name. Setspec.rabbitmqClusterReference.nameto that name. See Getting Started.