feat: add pluginable RabbitMQ broker support (closes #28)#151
Open
singhanurag0317-bit wants to merge 1 commit into
Open
feat: add pluginable RabbitMQ broker support (closes #28)#151singhanurag0317-bit wants to merge 1 commit into
singhanurag0317-bit wants to merge 1 commit into
Conversation
Introduces BROKER_TYPE and BROKER_URL settings so operators can
switch between Redis and RabbitMQ without code changes.
Changes
-------
* config.py - new BROKER_TYPE ("redis"|"rabbitmq") and BROKER_URL
settings; BROKER_URL falls back to REDIS_URL when left empty so
existing deployments are unaffected.
* taskiq/taskiq.py - creates AioPikaBroker when BROKER_TYPE=rabbitmq
(via taskiq-aio-pika); retains ListQueueBroker + RedisAsyncResultBackend
for Redis. TLS/SSL context built automatically for amqps:// and rediss://.
* celery/celery.py - creates Celery with amqp(s):// broker and rpc://
result backend when BROKER_TYPE=rabbitmq (no extra store required);
uses Redis URL + backend otherwise. SSL options applied per transport.
* pyproject.toml - adds taskiq-aio-pika>=0.6.0 and aio-pika>=9.0.0
as project dependencies.
Usage (RabbitMQ)
----------------
BROKER_TYPE=rabbitmq
BROKER_URL=amqp://guest:guest@localhost:5672/
Leave both unset (or BROKER_TYPE=redis) to keep existing Redis behaviour.
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.
Introduces BROKER_TYPE and BROKER_URL settings so operators can switch between Redis and RabbitMQ without code changes.
Changes
Usage (RabbitMQ)
BROKER_TYPE=rabbitmq BROKER_URL=amqp://guest:guest@localhost:5672/
Leave both unset (or BROKER_TYPE=redis) to keep existing Redis behaviour.