26
AMQP Messaging OKCJUG - January 2014 - Ryan Hoegg

AMQP and RabbitMQ (OKCJUG, January 2014)

Embed Size (px)

DESCRIPTION

Introduction to AMQP and RabbitMQ

Citation preview

Page 1: AMQP and RabbitMQ (OKCJUG, January 2014)

AMQP MessagingOKCJUG - January 2014 - Ryan Hoegg

Page 2: AMQP and RabbitMQ (OKCJUG, January 2014)

Messaging?

Notify another system

Work queue

Decouple deployments

Page 3: AMQP and RabbitMQ (OKCJUG, January 2014)

The Broker

Accepts messages from publishers

Delivers messages to consumers

Page 4: AMQP and RabbitMQ (OKCJUG, January 2014)

Queue

XX

Page 5: AMQP and RabbitMQ (OKCJUG, January 2014)

Queue

XX

Page 6: AMQP and RabbitMQ (OKCJUG, January 2014)

Publish / Subscribe

Consumers can listen when they want

Many consumers could get the message

Page 7: AMQP and RabbitMQ (OKCJUG, January 2014)

Open standard for messaging middleware

Defines a networking protocol

Defines semantics of broker services

Page 8: AMQP and RabbitMQ (OKCJUG, January 2014)

The Message

Payload (byte[])

Attributes (key/value pairs)

Page 9: AMQP and RabbitMQ (OKCJUG, January 2014)

Queue

Page 10: AMQP and RabbitMQ (OKCJUG, January 2014)

Queue

Page 11: AMQP and RabbitMQ (OKCJUG, January 2014)

Queue

name

attributes

durableexclusiveauto-deletearguments

Page 12: AMQP and RabbitMQ (OKCJUG, January 2014)

Exchange

Page 13: AMQP and RabbitMQ (OKCJUG, January 2014)

Exchange

name

type

attributes

durableauto-deletearguments

Page 14: AMQP and RabbitMQ (OKCJUG, January 2014)

Binding

Rule used by exchange to route messages to a queue

Has optional routing key

Page 15: AMQP and RabbitMQ (OKCJUG, January 2014)

Fanout Exchange

Simple pub/sub

Message routed to every queue bound to the exchange

Routing key is ignored

Page 16: AMQP and RabbitMQ (OKCJUG, January 2014)

Direct Exchange

Simple point-to-point

Message routed to queue if routing key matches binding exactly

Page 17: AMQP and RabbitMQ (OKCJUG, January 2014)

Topic Exchange

Message routed to queue based on routing-key match

Use dots within queue names and wildcards in routing keys

Page 18: AMQP and RabbitMQ (OKCJUG, January 2014)

Setting things up

Programmable: clients declare everything

Most servers come with management tools too, though

Page 19: AMQP and RabbitMQ (OKCJUG, January 2014)

Version Confusion

AMQP 0.9.1 widely implemented

AMQP 1.0 approved in October

They are very different

Page 20: AMQP and RabbitMQ (OKCJUG, January 2014)

Servers

RabbitMQ: http://www.rabbitmq.com/

OpenAMQ: http://www.openamq.org

Apache Qpid: http://qpid.apache.org/

Page 21: AMQP and RabbitMQ (OKCJUG, January 2014)

AMQP Alternatives

JMS (ActiveMQ is pretty good)

ZeroMQ

Amazon SQS

IronMQ

pubsubhubbub (RESTful)

redis

Page 22: AMQP and RabbitMQ (OKCJUG, January 2014)
Page 23: AMQP and RabbitMQ (OKCJUG, January 2014)

Installation

Provides installer for Windows, OSX, several linux distributions, solaris

Uses erlang runtime

Page 24: AMQP and RabbitMQ (OKCJUG, January 2014)

Management Plugin

$ rabbitmq-plugins enable rabbitmq_management

Page 25: AMQP and RabbitMQ (OKCJUG, January 2014)

Distributed Brokers

Clustering

HA Queues

Federation

Shovel

Page 26: AMQP and RabbitMQ (OKCJUG, January 2014)