3. • RabbitMQ
• ActiveMQ
• Apollo
• Kafka
• Kestrel
• Amazon SQS
• ZeroMQ*
• And many more…
Can you name any broker?
4. • RabbitMQ
• ActiveMQ
• Apollo
• Kafka
• Kestrel
• Amazon SQS
• ZeroMQ*
• And many more…
Why should you use one? Which one?
5. A case study: generating M$Office docs
• Produce content in Microsoft Office formats
• Many formats for each document
• Both Word and Excel docs
• XML content generated by CMS
• LibreOffice used to generate MS Office and PDF
versions
7. A case study: generating M$Office docs
Reality bites
• Slooow
• Rest assured that some of the docs will be pretty big
• Unreliable
• Depending on version, LO crashes from a-bit to almost-
always
• Race-prone
• Two conversion jobs in parallel might step on each other
8. A case study: generating M$Office docs
…and the results are:
9. A case study: generating M$Office docs
…and the results are:
• Ugly code: lots of polling, copying of files around,
manual locking
• Does not scale at all: only one conversion process
active at any given time
Web
server
PHP
Libre
Office
Waiting processes
10. TextBook scenario for introducing queues
Web
server
Worker
?
Rabbit
MQ
Libre
Office
PHP
11. TextBook scenario for introducing queues
Web
server
Worker
?
Rabbit
MQ
Libre
Office
PHP
12. TextBook scenario for introducing queues
Web
server
PHP
!
Rabbit
MQ
Libre
Office
PHP
13. TextBook scenario for introducing queues
Web
server
PHP
!
Rabbit
MQ
Libre
Office
PHP
14. TextBook scenario for introducing queues
Web
server
Symfony
!!!
Rabbit
MQ
Libre
Office
PHP
15. TextBook scenario for introducing queues
Web
server
Symfony
!!!
Rabbit
MQ
Libre
Office
PHP
16. Is there a bundle for that ?
oldsound/rabbitmq-bundle
17. Is there a bundle for that ?
oldsound/rabbitmq-bundle
• Specific to RabbitMQ
• Consumers are long-lived php processes
• fatal errors
• mem leaks
• DB connections time out
• on your code or in a dependency?
18. A new hope
• kaliop/queueingbundle
• kaliop/queueingbundle-sqs
• kaliop/queueingbundle-stomp
22. Easy to use
• Message encoding taken care of
• Has events your code can listen to
Message
received
Do stuff
Consump
tion
failed
Message
consumed
Exception
24. A design focusing on safety
• The default consumer has been split in 2
• The listener is long lived
• The worker process is a Symfony console command
• It handles a single message then exits
Symfony
listener
Symfony
worker
Libre
Office
Queue
25. I’ll be here all night
THANK YOU
https://github.com/kaliop-uk/kueueingbundle
• @gggeek
• www.kaliop.co.uk