You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2018/08/04 16:57:19 UTC

[GitHub] ashb closed pull request #2143: [AIRFLOW-661] Add Celery broker_transport_options config

ashb closed pull request #2143: [AIRFLOW-661] Add Celery broker_transport_options config
URL: https://github.com/apache/incubator-airflow/pull/2143
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/airflow/configuration.py b/airflow/configuration.py
index cfccbe9a25..47106e7347 100644
--- a/airflow/configuration.py
+++ b/airflow/configuration.py
@@ -319,6 +319,10 @@ def run_command(command):
 # information.
 broker_url = sqla+mysql://airflow:airflow@localhost:3306/airflow
 
+# Celery broker transport options. Provide options in JSON format. Refer to
+# the Celery documentation for more information.
+broker_transport_options = {{}}
+
 # Another key Celery setting
 celery_result_backend = db+mysql://airflow:airflow@localhost:3306/airflow
 
diff --git a/airflow/executors/celery_executor.py b/airflow/executors/celery_executor.py
index 04414fbc08..a7d7114711 100644
--- a/airflow/executors/celery_executor.py
+++ b/airflow/executors/celery_executor.py
@@ -16,6 +16,7 @@
 import logging
 import subprocess
 import time
+import json
 
 from celery import Celery
 from celery import states as celery_states
@@ -39,6 +40,7 @@ class CeleryConfig(object):
     CELERYD_PREFETCH_MULTIPLIER = 1
     CELERY_ACKS_LATE = True
     BROKER_URL = configuration.get('celery', 'BROKER_URL')
+    BROKER_TRANSPORT_OPTIONS = json.loads(configuration.get('celery', 'BROKER_TRANSPORT_OPTIONS'))
     CELERY_RESULT_BACKEND = configuration.get('celery', 'CELERY_RESULT_BACKEND')
     CELERYD_CONCURRENCY = configuration.getint('celery', 'CELERYD_CONCURRENCY')
     CELERY_DEFAULT_QUEUE = DEFAULT_QUEUE


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services