Skip to content

feat: add pluginable RabbitMQ broker support (closes #28)#151

Open
singhanurag0317-bit wants to merge 1 commit into
Team-NoxVeil:mainfrom
singhanurag0317-bit:feat/pluginable-rabbitmq-broker
Open

feat: add pluginable RabbitMQ broker support (closes #28)#151
singhanurag0317-bit wants to merge 1 commit into
Team-NoxVeil:mainfrom
singhanurag0317-bit:feat/pluginable-rabbitmq-broker

Conversation

@singhanurag0317-bit
Copy link
Copy Markdown

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.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant