RabbitMQ and Message Queuing

Gökhan GÖKALP

10.06.2017

Devnot Atölye

Gökhan GÖKALP

  • 10 years software development experience.
  • Currently working at Trendyol.com as a software architect.
  • My personal blog: www.gokhan-gokalp.com
  • I published a book about Asp.NET Web API.

1 billion TL sales in 2016

#1 fashion e-tailer in Turkey

70% women online shoppers

visit Trendyol

80% Growth in sales in 2016

Profitable since 2014

Biggest internet employer

1200 People

Our continuously growing and updating tech stack:

 

.net mvc, .net web-api, javascript, jquery, node.js, elastic search, redis, couchbase, rabbitmq, objective c, saas, less, ecmascript 6, react , ms sql, angular.js, typescript, android, selenium, java

  • What's the Messaging Systems?
  • What's the Message Queuing?
  • Overview of AMQP Protocol
  • AMQP Terminology
  • AMQP Components
  • AMQP Exchanges
  • AMQP Brokers
  • What's the RabbitMQ?
  • Overview of RabbitMQ
  • Components of RabbitMQ
  • RabbitMQ Clients

Agenda

What's the
Messaging Systems?

Messaging systems allow applications to communicate by sending messages to each other without any continual connection between each other.

What's the
Messaging Systems?

The Reactive Manifesto

  • 7/24 High Availability.
  • Less Response Time.
  • More Efficient Scaling with Decoupling​.

What's the
Messaging Systems?

Message Driven

Also, it is possible to host on the cloud easily.

Point-to-Point messaging style

Publish-Subscribe messaging style

What's the
Message Queuing?

Asynchronous operations are very important for building more an effective scalable system.

e.g. Bulk operations, image processing

What's the
Message Queuing?

Asynchronous operations are very easy with using message queue implementation such as RabbitMQ.

What's the
Message Queuing?

  • Autonomous and asynchronous operations.
  • Long-running business processes.
  • Easy to maintain.
  • Independent release plans. (CI&CD)
  • Technical decoupling. (e.g. Payment Service could be written in C#, Python or Java)

decoupling

What's the
Message Queuing?

  • Asynchronous communication is provided via message brokers such as RabbitMQ, MSMQ, ActiveMQ, Kafka.
  • Like an Amazon' payment style.

Overview of AMQP Protocol

AMQP is a standard protocol of message queuing, which was built for reliable message transmission between systems.

Open protocol standart for Enterprise Messaging
  • Security - TLS
  • Reliability - Acknowledgements and confirms. Heartbeats for dead and idle TCP connections.
  • Interoperability

Key Points

AMQP Terminology

  • Broker: AMQP server called broker. Implementing the AMQP model.
  • Producer: An application which send messages to a queue via an exchange.
  • Consumer: An application which receives message(s).
  • Message: Content of data.

AMQP Components

  • Exchange: Exchanges use messages' routing keys and route them to relevant queues.
  • Queue: Where messages are stored and then consumers get the messages from queues. (it can be durable or transient)
  • Bindings: Rules for distributing messages from exchanges to queues.

AMQP Exchanges

  • Direct Exchange
  • Topic Exchange
  • Fanout Exchange
  • Headers Exchange

Direct Exchange

A direct exchange delivers messages to queues based on the message routing key. A direct exchange is ideal for the unicast routing of messages.

Topic Exchange

Topic exchanges route messages to queues based on wildcard matches between the routing key and something called the routing pattern specified by the queue binding. Topic exchanges are commonly used for the multicast routing of messages.

Fanout Exchange

The fanout copies and routes a received message to all queues that are bound to it regardless of routing keys or pattern matching as with direct and topic exchanges. Fanout exchanges are ideal for the broadcast routing of messages.

event

Headers Exchange

Which allows simple queries on properties in the headers of a message.

AMQP Brokers

  • RabbitMQ
  • ActiveMQ
  • Apache Qpid
  • ZeroMQ

Implementations

  • STOMP
  • MQTT

Alternatives

What's the RabbitMQ?

RabbitMQ is lightweight and easy to deploy on premise and in the cloud. Also can be deployed in distributed.


Also RabbitMQ runs on many operating systems.

RabbitMQ is the most widely deployed open source message broker

Overview of RabbitMQ

 

  • RabbitMQ written in Erlang.
  • Implementing AMQP model. (also STOMP, MQTT)
  • With more than 35,000 production deployments of RabbitMQ world-wide at small startups and large enterprises. (e.g. SoundCloud, Instagram, Ford, Cisco and NASA Nebula Cloud Computing project)
  • It gives your applications a common platform to send and receive messages
  • Reliable message communication.

Components of RabbitMQ

  • Broker
  • Management Plugin for Management and Monitoring
    • Web
    • CLI 
  • Plugins (official&community)
    • Federation plugin
    • Shovel plugin

RabbitMQ Clients

  • .NET
  • Python
  • Java/Scala/Groovy
  • Node.js
  • Go
  • Ruby
  • Erlang
  • many more...

References

Contacts

Thanks...

RabbitMQ and Message Queuing

By Gökhan Gökalp

RabbitMQ and Message Queuing

RabbitMQ and Message Queuing presentation at Devnot Atölye - https://www.eventbrite.com/e/rabbitmq-ve-message-queue-yaplar-tickets-34988908768

  • 4,102