Skip to content

Commit

Permalink
Merge pull request #41 from epandurski/master
Browse files Browse the repository at this point in the history
Declare alternate-exchange for creditors_out
  • Loading branch information
epandurski authored Jul 12, 2024
2 parents 8574673 + 5681ede commit 5d86e77
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Containers started from the generated docker image must have access to the
following services:

1. [RabbitMQ] server instance, which acts as broker for SMP messages.
The [rabbitmq_random_exchange plugin] should be enabled.

For each peer node, at least one [RabbitMQ queue] must be configured on
the broker instance, so that all SMP messages that need to be send to a
Expand Down Expand Up @@ -211,6 +212,7 @@ How to setup a development environment
[RabbitMQ]: https://www.rabbitmq.com/
[RabbitMQ queue]: https://www.cloudamqp.com/blog/part1-rabbitmq-for-beginners-what-is-rabbitmq.html
[RabbitMQ exchange]: https://www.cloudamqp.com/blog/part4-rabbitmq-for-beginners-exchanges-routing-keys-bindings.html
[rabbitmq_random_exchange plugin]: https://github.com/rabbitmq/rabbitmq-random-exchange
[scripts]: https://github.com/swaptacular/swpt_ca_scripts
[Docker Engine]: https://docs.docker.com/engine/
[Docker Compose]: https://docs.docker.com/compose/
Expand Down
8 changes: 7 additions & 1 deletion swpt_stomp/configure_queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,14 @@ async def bind_queue() -> None:
elif owner_node_type == NodeType.CA:
assert peer_node_type == NodeType.AA
owner_prefix = "ca"
await channel.declare_exchange(
"ca.loopback_filter", "headers", durable=True
)
main_exchange = await channel.declare_exchange(
"creditors_out", "topic", durable=True
"creditors_out",
"topic",
durable=True,
arguments={"alternate-exchange": "ca.loopback_filter"},
)
binding_key = peer_data.debtors_subnet.binding_key
else:
Expand Down

0 comments on commit 5d86e77

Please sign in to comment.