collective.documentviewer with redis backed celery tasks on Plone 4 and 5

Apr 06, 2017
collective.documentviewer integrates the Document cloud document viewer into Plone to provide a nice preview of files, including search, first-page-screenshots and many other features. In this post we will explain how to setup collective.documentviewer to use celery based tasks to convert the documents.

We are long time users of collective.documentviewer as a file viewer in Plone 4. We have it installed, for instance, in Egoibarra.eus and Eibar.eus to show books, magazines, reports and decisions produced in different formats (mainly PDF and MS-Word DOC and DOCX files).

When we first set up the viewer, we installed it using plone.app.async based asynchronous tasks because back then it was the only way to free the main Zope instance threads from doing the document conversion process.

Some weeks ago, we had to install collective.documentviewer in a yet-to-be-published new Plone 5 site and realised that now celery can be used to handle those async tasks. The installation was very easy and we were very satisfied with the results, so we upgraded and migrated the old Plone 4 site to use celery to do the document conversion.

The configuration is very easy, and you can find an example buildout for both Plone 4 and Plone 5 that uses celery to do all the hard work.

In both cases you will need to install redis on your server. You can just apt-get install redis-server or run a docker container: docker run -p 6379:6379 -d redis.

The buildout creates a supervisor (started with bin/supervisord) that runs the ZEO server, Plone server and the celery worker). 

Comment

To comment this article you have to log in using your Facebook, Twitter or Google account.

Mikel Larreategi

Plone developer. Chess International Arbiter #truestory