Slide 1

Slide 1 text

Message Queues A basic overview

Slide 2

Slide 2 text

Geshan Manandhar Quality and Maintenance Lead, Namshi.com @geshan geshan.com.np

Slide 3

Slide 3 text

Index What is Message Queue(MQ) MQ basics - AMQP Benefits Rabbit MQ Our setup/stack When to use it /Practical Usecase Logging and monitoring Conclusion

Slide 4

Slide 4 text

What is Message Queue "message queues and mailboxes are software-engineering components used for inter-process communication (IPC), or for inter-thread communication within the same process. They use a queue for messaging – the passing of control or of content." - Wikipedia Message queue is a software components that allow producers to produce message to a queue managed by a message broker, these message are asynchronously consumed by consumers.

Slide 5

Slide 5 text

Message Queue Basics Protocols : Advanced Message Queueing Protocol(AMQP) and Streaming Text Oriented Messaging Protocol(STOMP) Types of Queue: Direct, Topic and Fanout Producer/Publisher Message Broker - Queue Exchange Queue Consumer

Slide 6

Slide 6 text

Benefits of MQ Decoupling Scalability Reliability Fanout - Same message to multiple queues (Pub/Sub)

Slide 7

Slide 7 text

Rabbit MQ

Slide 8

Slide 8 text

Rabbit MQ - features Robust messaging for applications Easy to use Runs on all major operating systems Supports a huge number of developer platforms Open source and commercially supported

Slide 9

Slide 9 text

Our Software stack/services relating to with Rabbit MQ Symfony 2 with old sound rabbit mq bundle and Monolog Rabbit Mq on http://www.cloudamqp.com/ Service Oriented Architecture (SOA) with 3rd party API integrations

Slide 10

Slide 10 text

When to use message queues Some practical use cases Backend -> Frontend sync (db to NOSQL/Memcache) Communication between multiple internal systems (without API) Asynchronous 3rd party API calls Notifications like email and sms Handling large request asynchronously Processing intensive tasks- like image resize

Slide 11

Slide 11 text

Logging and monitoring is vital Only access and error logs from web server and database are surely not enough Logs are first class citizen, adopt active logging from application level.(Monolog) Use dedicated log management system like GrayLog 2 Monitor application activity in real-time with services like NewRelic Log optimally and verbose enough to give enough information about the context.

Slide 12

Slide 12 text

Conclusion/Recap Communication between two systems can be done even without APIs Language agnostic implementation is enable by using message queues Message queues could be that answer you were looking for, to communicate between different systems For scalability, decoupling and reliability utilize message queues You could potentially scale to 1 million message per second : Pivotal Logging and monitoring are inevitable when doing asynchronous processing

Slide 13

Slide 13 text

No content

Slide 14

Slide 14 text

Questions???

Slide 15

Slide 15 text

Credits http://keyholesoftware.com/2013/05/13/messaging-with-rabbitmq/ https://www.flickr.com/photos/i8ipod/9028050858 https://www.flickr.com/photos/oberazzi/318947873/

Slide 16

Slide 16 text

Some programming mantras to remember.