Skip to content

Commit

Permalink
Add a more complete federation example.
Browse files Browse the repository at this point in the history
  • Loading branch information
niclic committed Jun 17, 2020
1 parent 01ed4a2 commit 39760fa
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion website/docs/r/federation-upstream.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,24 @@ resource "rabbitmq_permissions" "guest" {
}
}
// downstream exchange
resource "rabbitmq_exchange" "foo" {
name = "foo"
vhost = rabbitmq_permissions.guest.vhost
settings {
type = "topic"
durable = "true"
}
}
// upstream broker
resource "rabbitmq_federation_upstream" "foo" {
name = "foo"
vhost = rabbitmq_permissions.guest.vhost
definition {
uri = "amqp://server-name"
uri = "amqp://guest:guest@upstream-server-name:5672/%2f"
prefetch_count = 1000
reconnect_delay = 5
ack_mode = "on-confirm"
Expand All @@ -41,6 +53,21 @@ resource "rabbitmq_federation_upstream" "foo" {
}
}
resource "rabbitmq_policy" "foo" {
name = "foo"
vhost = rabbitmq_permissions.guest.vhost
policy {
pattern = "(^${rabbitmq_exchange.foo.name}$)"
priority = 1
apply_to = "exchanges"
definition = {
federation-upstream = rabbitmq_federation_upstream.foo.name
}
}
}
```

## Argument Reference
Expand Down

0 comments on commit 39760fa

Please sign in to comment.