Docker Phalcon Beanstalkd worker

I'm wondering if somebody already experimented with a docker container that watches a beanstalkd using phalcon and execute some work and is willing to share some code. Thinking about creating a container that I can easily scale when needed but would love to get some ideas how to setup this image.



1.8k
edited 25d ago

Yes I do. For docker I used two containers, once for beanstalkd the other one for the console. This are the images I've used in my docker-compose: > > queue:
> restart: always
> image: phalconphp/beanstalkd:1.10
> containername: beanstalk
> ports:
> - "11300:11300"
> volumes:
> - beanstalk:/var/lib/beanstalkd
>
> beanstalk
console:
> restart: always
> image: agaveapi/beanstalkd-console
> containername: beanstalkconsole
> ports:
> - "5556:80"
> dependson:
> - queue
> env
file:
> - variables.env
>

For beanstalk inside phalcon I've written a module, using cli interface for executing the queue workers and integrating the Incubator beanstalk extension.

Sadly, beanstalkd is deprecated project. So I hesitate to use it in a production (new projects) like I used to... still it is very neat MQ broker.



1.8k
edited 24d ago

AWS is still proposing beanstalk and it is still working well. What do you suggest for replacing it? I think at the moment, even for new projects, beanstalk remain the best solution for integrating queues in phalcon, but we can start watching and working on wrappers for other systems..

I think we should implement in incubator or in core at least 2 other queues mostly used - redis and rabbit mq.

Rabbit MQ to start with. Any MQ solution which is current - and supported.

>AWS is still proposing beanstalk and it is still working well. What do you suggest for replacing it? >I think at the moment, even for new projects, beanstalk remain the best solution for integrating queues in phalcon, but we can start watching and working on wrappers for other systems..



1.8k

@ruudboon How have you structured logging with queues? I think logs are one of the most critical part when using asyncronous queues and they are the weak part of my implementation.



1.9k
edited 15d ago

@cosimo I outputting to the stdout that can easily read by docker. At this point I use beanstalk to easily offload heavy work (Generate PDF's). I write the final status (succes/failed etc) in the database. And thnx for the docker code!