#11 Celery Tip - Which I Bet You Didn't Know

Did you know that you can use filesystem as broker transport in Celery?

This lesson will show you how. Use of filesystem as transport saves you a lot of time in development and testing environments.

You don't need to install rabbitmq, redis or any other broker software on your development environment to make full use of celery. Just change CELERY_BROKER_URL = "filesystem://"   in your configurations and you are almost done. This is possible due to undocumented feature of kombu. Watch full video lesson to fully understand mechanics behind it. As convenience below are configurations I use in video lesson.

Django App side configuration:

    
CELERY_BROKER_URL = "filesystem://"
CELERY_BROKER_TRANSPORT_OPTIONS = {
    'data_folder_out': '/lesson-11/broker/queue/',
    'data_folder_in': '/lesson-11/broker/queue/',
}
    

Worker side configuration:

    
app = Celery()

app.conf.update({
    'broker_url': 'filesystem://',
    'broker_transport_options': {
        'data_folder_in': '/lesson-11/broker/queue/',
        'processed_folder': '/lesson-11/broker/processed/',
        'store_processed': True
    },
    'include': 'worker.tasks',
})
    
Wow, no similar lessons found! You have just found a very unique lesson!