[PR #358] [MERGED] refact: Make topic explicit in message queue API #416

Closed
opened 2026-02-16 01:17:15 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/run-llama/llama_deploy/pull/358
Author: @masci
Created: 11/12/2024
Status: Merged
Merged: 11/13/2024
Merged by: @masci

Base: mainHead: massi/topic-refact


📝 Commits (5)

📊 Changes

39 files changed (+470 additions, -353 deletions)

View changed files

📝 .pre-commit-config.yaml (+1 -1)
📝 e2e_tests/apiserver/test_streaming.py (+1 -2)
e2e_tests/message_queues/message_queue_kafka/conftest.py (+103 -0)
📝 e2e_tests/message_queues/message_queue_kafka/test_message_queue.py (+20 -21)
e2e_tests/message_queues/message_queue_kafka/workflow.py (+12 -0)
📝 llama_deploy/apiserver/deployment.py (+4 -6)
📝 llama_deploy/client/models/apiserver.py (+14 -18)
📝 llama_deploy/client/models/model.py (+1 -1)
📝 llama_deploy/control_plane/__init__.py (+3 -2)
📝 llama_deploy/control_plane/base.py (+7 -3)
llama_deploy/control_plane/config.py (+30 -0)
📝 llama_deploy/control_plane/server.py (+58 -94)
📝 llama_deploy/deploy/deploy.py (+4 -4)
📝 llama_deploy/message_publishers/publisher.py (+11 -6)
📝 llama_deploy/message_queues/apache_kafka.py (+26 -19)
📝 llama_deploy/message_queues/aws.py (+10 -10)
📝 llama_deploy/message_queues/base.py (+7 -15)
📝 llama_deploy/message_queues/rabbitmq.py (+10 -9)
📝 llama_deploy/message_queues/redis.py (+6 -6)
📝 llama_deploy/message_queues/simple.py (+12 -15)

...and 19 more files

📄 Description

Apologies for the mega-refactoring, breaking this down into smaller PR would take a week 😛

Fixes #349 for good.

Problem

Message publishers and subcribers assumed the "topic" to listen to was the same as the message type. This works in a single-tenant environment but becomes a problem when the same message queue holds data for multiple control planes and services, causing clashes.

Solution

  • Make the concept of "topic" explicit, so that when publishing/reading messages a topic must be provided
  • Make the topics "nested" under the control plane, like control_plane_one.my_service so that services with the same name attached to different control planes can coexist
  • Make the topic "namespace" configurable, so that users can specify where to nest topics used in Llama Deploy and avoid conflicts with their existing, unrelated topics

Follow up

  • Fix topic management for the other message queues we support, for now only Kafka is taking advantage of this feature

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/run-llama/llama_deploy/pull/358 **Author:** [@masci](https://github.com/masci) **Created:** 11/12/2024 **Status:** ✅ Merged **Merged:** 11/13/2024 **Merged by:** [@masci](https://github.com/masci) **Base:** `main` ← **Head:** `massi/topic-refact` --- ### 📝 Commits (5) - [`5d85407`](https://github.com/run-llama/llama_deploy/commit/5d8540759ebe3e90bddaedd2db3a372b17dd09bd) Make topic explicit in message queue API - [`13b5d71`](https://github.com/run-llama/llama_deploy/commit/13b5d7153f728f10f4739d0cbb9b293215f62f1b) fix unit tests - [`be7b147`](https://github.com/run-llama/llama_deploy/commit/be7b1479656e4d362ac1c28f7a7e057d6f144003) more fixes - [`97c44a0`](https://github.com/run-llama/llama_deploy/commit/97c44a0da469458295eeae31d48b8bb0a7961d8e) fix quotes in e2e code - [`1997f1e`](https://github.com/run-llama/llama_deploy/commit/1997f1e8fd20c900ad969e5315ee401e96678202) better naming ### 📊 Changes **39 files changed** (+470 additions, -353 deletions) <details> <summary>View changed files</summary> 📝 `.pre-commit-config.yaml` (+1 -1) 📝 `e2e_tests/apiserver/test_streaming.py` (+1 -2) ➕ `e2e_tests/message_queues/message_queue_kafka/conftest.py` (+103 -0) 📝 `e2e_tests/message_queues/message_queue_kafka/test_message_queue.py` (+20 -21) ➕ `e2e_tests/message_queues/message_queue_kafka/workflow.py` (+12 -0) 📝 `llama_deploy/apiserver/deployment.py` (+4 -6) 📝 `llama_deploy/client/models/apiserver.py` (+14 -18) 📝 `llama_deploy/client/models/model.py` (+1 -1) 📝 `llama_deploy/control_plane/__init__.py` (+3 -2) 📝 `llama_deploy/control_plane/base.py` (+7 -3) ➕ `llama_deploy/control_plane/config.py` (+30 -0) 📝 `llama_deploy/control_plane/server.py` (+58 -94) 📝 `llama_deploy/deploy/deploy.py` (+4 -4) 📝 `llama_deploy/message_publishers/publisher.py` (+11 -6) 📝 `llama_deploy/message_queues/apache_kafka.py` (+26 -19) 📝 `llama_deploy/message_queues/aws.py` (+10 -10) 📝 `llama_deploy/message_queues/base.py` (+7 -15) 📝 `llama_deploy/message_queues/rabbitmq.py` (+10 -9) 📝 `llama_deploy/message_queues/redis.py` (+6 -6) 📝 `llama_deploy/message_queues/simple.py` (+12 -15) _...and 19 more files_ </details> ### 📄 Description Apologies for the mega-refactoring, breaking this down into smaller PR would take a week 😛 Fixes #349 for good. ## Problem Message publishers and subcribers assumed the "topic" to listen to was the same as the message type. This works in a single-tenant environment but becomes a problem when the same message queue holds data for multiple control planes and services, causing clashes. ## Solution - Make the concept of "topic" explicit, so that when publishing/reading messages a topic must be provided - Make the topics "nested" under the control plane, like `control_plane_one.my_service` so that services with the same name attached to different control planes can coexist - Make the topic "namespace" configurable, so that users can specify where to nest topics used in Llama Deploy and avoid conflicts with their existing, unrelated topics ## Follow up - Fix topic management for the other message queues we support, for now only Kafka is taking advantage of this feature --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-16 01:17:15 -05:00
yindo closed this issue 2026-02-16 01:17:15 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: run-llama/llama_deploy#416