Autocommit action=CREATE on file=oslo.messaging - How it works with rabbit.md detected

This commit is contained in:
Flatnotes 2024-05-05 18:09:43 +00:00
parent 1014610a8b
commit 854a37994b
1 changed files with 39 additions and 0 deletions

View File

@ -0,0 +1,39 @@
# Messaging in Openstack
## oslo_messaging
In PCI infra, oslo_messaging is configured using:
- rabbitmq driver for RPC server/agent communication
- kafka and log driver for notifications (send events to third party app)
### RPC implementation in rabbitmq
[RPC in openstack](https://docs.openstack.org/oslo.messaging/stein/reference/rpcclient.html) is implemented using oslo_messaging library.
!!! note "tldr"
- rpc call()
- blocking call to invoke a method on a topic with 1 reply expected
- rpc cast()
- invoke a method on a topic in 'best effort' mode without reply. If fanout=true message, is broadcasted to all topic consumers
In rabbitmq, a message is published to a queue using an exchange/routing_key.
Consumers are directly connected to a queue to read messages from.
A oslo.messaging 'topic' is almost equivalent to a rabbitmq queue.
With a rpc call, message will be sent to rabbitmq through exchange=target.exchange queue={target.topic}.{target.server}
Response will be sent back to caller using exchange=target.exchange queue={message.reply_queue}
With a rpc cast fanout=false, it's the same but there is no reply mechanism
With a rpc cast fanout=true, message will be sent to rabbitmq through exchange=target.exchange queue={target.topic}_fanout
For rpc call and rpc cast (fanout=false), we are using quorum queues (1 publisher / 1 consumer).
For rpc cast (fanout=true), stream queues are used because it's purpose is to broadcast messages (1 publisher / N consumers).
On startup, every server/agent declare queues they will consume from. If queue does not exist on rabbit cluster, it is created.
It's the same for publishing part with the exchange.