Browse Source

Adding support for the `BROKER_BACKEND_EXTRA_ARGS` configuration option, an optional dict() which can be used to pass connection arguments to alternative broker implementations (like `sqlakombu`).

Ryan Petrello 14 years ago
parent
commit
d860590da8
2 changed files with 3 additions and 1 deletions
  1. 2 1
      celery/app/base.py
  2. 1 0
      celery/app/defaults.py

+ 2 - 1
celery/app/base.py

@@ -167,7 +167,8 @@ class BaseApp(object):
                     insist=self.either("BROKER_INSIST", insist),
                     insist=self.either("BROKER_INSIST", insist),
                     ssl=self.either("BROKER_USE_SSL", ssl),
                     ssl=self.either("BROKER_USE_SSL", ssl),
                     connect_timeout=self.either(
                     connect_timeout=self.either(
-                                "BROKER_CONNECTION_TIMEOUT", connect_timeout))
+                                "BROKER_CONNECTION_TIMEOUT", connect_timeout),
+                    backend_extra_args=self.conf.BROKER_BACKEND_EXTRA_ARGS)
 
 
     def with_default_connection(self, fun):
     def with_default_connection(self, fun):
         """With any function accepting `connection` and `connect_timeout`
         """With any function accepting `connection` and `connect_timeout`

+ 1 - 0
celery/app/defaults.py

@@ -52,6 +52,7 @@ NAMESPACES = {
         "CONNECTION_MAX_RETRIES": Option(100, type="int"),
         "CONNECTION_MAX_RETRIES": Option(100, type="int"),
         "INSIST": Option(False, type="bool"),
         "INSIST": Option(False, type="bool"),
         "USE_SSL": Option(False, type="bool"),
         "USE_SSL": Option(False, type="bool"),
+        "BACKEND_EXTRA_ARGS": Option({}, type="dict")
     },
     },
     "CELERY": {
     "CELERY": {
         "ACKS_LATE": Option(False, type="bool"),
         "ACKS_LATE": Option(False, type="bool"),