fix: Switch from Azure Service Bus to RabbitMQ for task queue#620
Merged
Conversation
Azure Service Bus is incompatible with Kombu 5.x used by Celery 5.3.6. All versions of azure-servicebus 7.x have breaking module structure changes that prevent Kombu from connecting, causing production worker failures. Changes: - Remove hardcoded LOKOLE_QUEUE_BROKER_SCHEME=azureservicebus from docker-compose.prod.yml - Add RabbitMQ service (rabbitmq:management-alpine) to production compose - Worker now depends on RabbitMQ service - Add URL encoding for broker credentials to handle special characters (/, =, +) - Add rabbitmq_data volume for queue persistence - Uses existing credentials (LOKOLE_EMAIL_SERVER_QUEUES_SAS_NAME/KEY) for RabbitMQ auth Production setup: Add these two lines to secrets/azure.env: LOKOLE_QUEUE_BROKER_SCHEME=amqp LOKOLE_EMAIL_SERVER_QUEUES_NAMESPACE=rabbitmq This fixes the production worker failures with TypeError and RuntimeError when trying to connect to Azure Service Bus.
1a0e0a6 to
7e2c45d
Compare
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.
Problem
Azure Service Bus is incompatible with Kombu 5.x used by Celery 5.3.6, causing production worker failures with:
TypeError: isinstance() arg 2 must be a type or tuple of typesRuntimeError: can't start new threadAll versions of azure-servicebus 7.x have breaking module structure changes that prevent Kombu from connecting. Exhaustive testing confirmed no combination of azure-servicebus/kombu/celery versions works with Python 3.9.
Solution
Switch from Azure Service Bus to RabbitMQ for the task queue:
LOKOLE_QUEUE_BROKER_SCHEME=azureservicebusfrom production compose/,=,+)rabbitmq_datavolume for queue persistenceProduction Deployment
Add these two lines to
secrets/azure.envon the production server:Existing credentials (
LOKOLE_EMAIL_SERVER_QUEUES_SAS_NAMEandLOKOLE_EMAIL_SERVER_QUEUES_SAS_KEY) will be reused for RabbitMQ authentication.Testing
✅ Tested locally with RabbitMQ 4.3.1 - worker connects successfully
✅ All 7 queues properly defined as durable (from PR #619)
✅ URL encoding handles special characters in credentials
Related