Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Symfony vs. Message Brokers

616 views

Published on

Symfony vs. Message Brokers

Published in: Internet
  • Be the first to comment

Symfony vs. Message Brokers

  1. 1. It’s all about eXperience Gaetano Giunta Symfony Live Sept 2016 Symfony vs. Message Brokers (tip: Symfony wins)
  2. 2. Message brokers in 1000 words
  3. 3. • RabbitMQ • ActiveMQ • Apollo • Kafka • Kestrel • Amazon SQS • ZeroMQ* • And many more… Can you name any broker?
  4. 4. • RabbitMQ • ActiveMQ • Apollo • Kafka • Kestrel • Amazon SQS • ZeroMQ* • And many more… Why should you use one? Which one?
  5. 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
  6. 6. A case study: generating M$Office docs Reality bites
  7. 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. 8. A case study: generating M$Office docs …and the results are:
  9. 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. 10. TextBook scenario for introducing queues Web server Worker ? Rabbit MQ Libre Office PHP
  11. 11. TextBook scenario for introducing queues Web server Worker ? Rabbit MQ Libre Office PHP
  12. 12. TextBook scenario for introducing queues Web server PHP ! Rabbit MQ Libre Office PHP
  13. 13. TextBook scenario for introducing queues Web server PHP ! Rabbit MQ Libre Office PHP
  14. 14. TextBook scenario for introducing queues Web server Symfony !!! Rabbit MQ Libre Office PHP
  15. 15. TextBook scenario for introducing queues Web server Symfony !!! Rabbit MQ Libre Office PHP
  16. 16. Is there a bundle for that ? oldsound/rabbitmq-bundle
  17. 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. 18. A new hope • kaliop/queueingbundle • kaliop/queueingbundle-sqs • kaliop/queueingbundle-stomp
  19. 19. Multiple protocol support
  20. 20. Multiple protocol support Kaliop Queueing Bundles fusesource/stomp-phpaws/aws-sdk-php oldsound/rabbitmq ActiveMQ ApolloSQS RabbitMQ Application
  21. 21. Easy to use
  22. 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
  23. 23. A design focusing on safety
  24. 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. 25. I’ll be here all night THANK YOU https://github.com/kaliop-uk/kueueingbundle • @gggeek • www.kaliop.co.uk

×