From 854a37994bc8e941bbbef6d905fb1bf75ffed88d Mon Sep 17 00:00:00 2001 From: Flatnotes Date: Sun, 5 May 2024 18:09:43 +0000 Subject: [PATCH] Autocommit action=CREATE on file=oslo.messaging - How it works with rabbit.md detected --- oslo.messaging - How it works with rabbit.md | 39 ++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 oslo.messaging - How it works with rabbit.md diff --git a/oslo.messaging - How it works with rabbit.md b/oslo.messaging - How it works with rabbit.md new file mode 100644 index 0000000..f6d75e8 --- /dev/null +++ b/oslo.messaging - How it works with rabbit.md @@ -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. \ No newline at end of file