Fix(rabbitmq): Handle exchange and routing key based on cloud env for…#667
Merged
Fix(rabbitmq): Handle exchange and routing key based on cloud env for…#667
Conversation
… specific message types Refactor rabbitmq_publish_message to correctly handle exchange and routing key determination based on the presence of MEMSCHEDULER_RABBITMQ_EXCHANGE_NAME environment variable and the message label. - Default exchange and routing key are used for most messages. - 'knowledgeBaseUpdate' messages always have an empty routing key. - If MEMSCHEDULER_RABBITMQ_EXCHANGE_NAME is set, and the message label is 'taskStatus' or 'knowledgeBaseUpdate', the exchange is overridden with the environment variable's value, and the routing key is set to empty. This fixes the 'taskStatus' routing issue in cloud environments. - Logging for cloud-affected messages is now specific and separate from local 'knowledgeBaseUpdate' logging.
tangg555
approved these changes
Dec 9, 2025
tianxing02
pushed a commit
to tianxing02/MemOS
that referenced
this pull request
Feb 24, 2026
MemTensor#667) Fix(rabbitmq): Handle exchange and routing key based on cloud env for specific message types Refactor rabbitmq_publish_message to correctly handle exchange and routing key determination based on the presence of MEMSCHEDULER_RABBITMQ_EXCHANGE_NAME environment variable and the message label. - Default exchange and routing key are used for most messages. - 'knowledgeBaseUpdate' messages always have an empty routing key. - If MEMSCHEDULER_RABBITMQ_EXCHANGE_NAME is set, and the message label is 'taskStatus' or 'knowledgeBaseUpdate', the exchange is overridden with the environment variable's value, and the routing key is set to empty. This fixes the 'taskStatus' routing issue in cloud environments. - Logging for cloud-affected messages is now specific and separate from local 'knowledgeBaseUpdate' logging. Co-authored-by: glin1993@outlook.com <>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
… specific message types
Refactor rabbitmq_publish_message to correctly handle exchange and routing key determination based on the presence of MEMSCHEDULER_RABBITMQ_EXCHANGE_NAME environment variable and the message label.
Description
Summary: (summary)
Fix: #(issue)
Docs Issue/PR: (docs-issue-or-pr-link)
Reviewer: @(reviewer)
Checklist: