Top Banner
Introduction to Message Queuing [email protected]
53

StormMQ Introduction to AMQP, Dublin

May 12, 2015

Download

Technology

StormMQ

StormMQ Introduction to AMQP, Dublin, in conjunction with IrishDev.com, 16th November 2010.
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 2: StormMQ Introduction to AMQP, Dublin

Agenda

A Real Application ! 20 min

Nibbles and Hands–On ! 60 min

Introduction to AMQP ! 20 min

Why Message Queuing? ! 25 min

Classic Architecture ! 10 min

Page 3: StormMQ Introduction to AMQP, Dublin

History of Message Queuing

Manual Telegraphy Machine Assisted Telegraphy

1920s1911 - 192019th Century 1900s

Telegrams sent using“Store and Forward”

1900

1930s

Page 4: StormMQ Introduction to AMQP, Dublin

History of Message Queuing

Telcos UseElectronic Telegraphy

1950s1940s 1960s

IBM System/360 with BTAM & QTAM

Message Switching

1964

First Electronic Mail Solutions

1965

Banking Users

1970s

IBM TCAM which is the first true solution

Retired 1990!

1971

Machine Assisted Telegraphy

Page 5: StormMQ Introduction to AMQP, Dublin

History of Message Queuing

First Electronic Mail

FMCG & Utilities

1990s

IBM Launch MQSeries(now WebsphereMQ)

1992

Machine Assisted Telegraphy Corporates Large Websites YOU

Noughties Today

Sun Release Java JMS, Reinvigorating

Enterprise Messaging

2001

AMQP Working Group Formed by Investment Banks

2006

Cloud Enables and Drives StormMQ

Adoption

2009

Page 6: StormMQ Introduction to AMQP, Dublin

The Integration Tag Soup

WS – File Transfer

!"#$%&'(#)#*#+%+

Message QueuingSOAP

EMail

SMTP

FTP

RSYNC

NTFS

!','-

!).$%&'/$.0%&1$%+

234%5)6!%$7%$

SOAMessage

OrientatedMiddleware

JMS

MQ

MQSeries

AMQP

Amazon SQS

Tibco

StormMQ

RabbitMQ

HTTP

TCP/IPDCE / RPC

CORBA

DCOM

REST

RMIXML-RPC

.NET Remoting

Remote Procedure Call

XML-RPC

Page 7: StormMQ Introduction to AMQP, Dublin

The Integration Tag Soup

WS – File Transfer

!"#$%&'(#)#*#+%+

Message QueuingSOAP

EMail

SMTP

FTP

RSYNC

NTFS

!','-

!).$%&'/$.0%&1$%+

234%5)6!%$7%$

SOAMessage

OrientatedMiddleware

JMS

MQ

MQSeries

AMQP

Amazon SQS

Tibco

StormMQ

RabbitMQ

HTTP

TCP/IPDCE / RPC

CORBA

DCOM

REST

RMIXML-RPC

.NET Remoting

Remote Procedure Call

XML-RPC

Page 8: StormMQ Introduction to AMQP, Dublin

The Integration Tag Soup

Message Queuing

XML-RPC

Page 9: StormMQ Introduction to AMQP, Dublin

Under Examination, though

Deployment

Intimate System Knowledge

Configuration

Admin

File Transfer

!"#$%&'(#)#*#+%+

Remote Procedure Call

Don’t Work in the Cloud

Scaling

Page 10: StormMQ Introduction to AMQP, Dublin

Ideal: Message Queuing

Systems are “loosely-coupled”

MessageQueuing

Systems don’t know each other

Page 11: StormMQ Introduction to AMQP, Dublin

Why Use it: Loose Coupling

BillingCatalogue

Shipping S-a-a-S Inventory

better position: Why do people

queuing? fonts

How do we connect them, without one outage or system change taking everything down like a pack of cards?

Page 12: StormMQ Introduction to AMQP, Dublin

Why Use it: Loose Coupling

BillingCatalogue

Shipping S-a-a-S Inventory

better position: Why do people

queuing? fonts

How do we connect them, without one outage or system change taking everything down like a pack of cards?

Message Queuing lets Systems and Components exchangedata, events, commands and actions with one another

with no explicit knowledge or need for them to be online

Page 13: StormMQ Introduction to AMQP, Dublin

It should be ideal for the cloud

Page 14: StormMQ Introduction to AMQP, Dublin

It should be ideal for the cloud

Page 15: StormMQ Introduction to AMQP, Dublin

!!!Until today, messaging is …

(ZeroMQ)

(SQS uses HTTP)

(MSMQ uses COM)

(memcached)

(Java JMSuses

Source)

(MQSeries / WebsphereMQ)

(Talarian, Rendezvous, etc)

Platform Restricted BespokeProprietary

Page 16: StormMQ Introduction to AMQP, Dublin

!!!Until today, messaging is …

(ZeroMQ)

(SQS uses HTTP)

(MSMQ uses COM)

(memcached)

(Java JMSuses

Source)

(MQSeries / WebsphereMQ)

(Talarian, Rendezvous, etc)

Page 17: StormMQ Introduction to AMQP, Dublin

Why is it Hell?

You need more staff And moneyYou need bridge technology

Page 18: StormMQ Introduction to AMQP, Dublin

Why is it Hell?

You need more staff And moneyYou need bridge technology

Page 19: StormMQ Introduction to AMQP, Dublin

However, there’s a solution

Page 20: StormMQ Introduction to AMQP, Dublin

A-MQPAdvanced Message Queue Protocol

However, there’s a solution

Page 21: StormMQ Introduction to AMQP, Dublin

However, AMQP fixes this

A common wire-level binary format and protocol

An explicit definition of a server (aka broker)’s

semantics

Open Means

Interoperable

Page 22: StormMQ Introduction to AMQP, Dublin

That is good …

“AMQP will be to Messaging what HTTP was to the Web”

MRG

Clients run on any Platform Vendors are Interoperable

Page 23: StormMQ Introduction to AMQP, Dublin

That is good …

“AMQP will be to Messaging what HTTP was to the Web”

MRG

Clients run on any Platform Vendors are Interoperable

64K

Page 24: StormMQ Introduction to AMQP, Dublin

From Anywhere to Anywhere

Page 25: StormMQ Introduction to AMQP, Dublin

From Anywhere to Anywhere

Page 26: StormMQ Introduction to AMQP, Dublin

Eddie Velez

Quick Recap

The fifth male memberof the A-Team, Frankie,

was played by

Question

Message Queuing connects systems and components. Is it ideal for the cloud?

Does Loose-Coupling make individualsystems more likely to suffer outages?

Yes

No

AMQP is Open.

This makes it suitable for programmingin C and Javascript?

!

Page 27: StormMQ Introduction to AMQP, Dublin

Agenda

Introduction to AMQP ! 20 min

Why Message Queuing? ! 25 min

Classic Architecture ! 10 min

A Real Application ! 20 min

Pizza and Hands–On ! 60 min

Page 28: StormMQ Introduction to AMQP, Dublin

Store and Forward

Billing

“Could you send me a duplicate of my bill please”

REST

StormMQMessaging

Billing

!

Page 29: StormMQ Introduction to AMQP, Dublin

Fire and Forget

Shipping

“Too many orders. The website is running like a dog.”

SQL Push SQL Pull

StormMQMessaging

Shipping

Page 30: StormMQ Introduction to AMQP, Dublin

One-To-Many

“There’s a new widget in the Catalogue: Tell all the systems.”

CatalogueShipping

S-a-a-S Inventory

File Transfer

ETL

Page 31: StormMQ Introduction to AMQP, Dublin

One-To-Many

“There’s a new widget in the Catalogue: Tell all the systems.”

CatalogueShipping

S-a-a-S InventoryStormMQMessaging

Page 32: StormMQ Introduction to AMQP, Dublin

StormMQMessaging

Round-Robin

Billing

“How do we easily scale a massive batch job like Billing?”

EMail BillGenerate

Page 33: StormMQ Introduction to AMQP, Dublin

StormMQMessaging

Publish-Subscribe (“Topics”)

“Shipments Sent, Delivered and Received”

Shipping

S-a-a-S InventoryBilling

RIASentSent or Returned

Page 34: StormMQ Introduction to AMQP, Dublin

22

Web Sockets Architecture

Copyright © 2010, Kaazing Corporation,. All rights reserved.

Page 35: StormMQ Introduction to AMQP, Dublin

Agenda

Introduction to AMQP ! 20 min

Why Message Queuing? ! 25 min

Classic Architecture ! 10 min

A Real Application ! 20 min

Nibbles and Hands–On ! 60 min

Page 36: StormMQ Introduction to AMQP, Dublin

Messaging: Which Jargon?

EMail(SMTP, POP3, IMAP)

VoIP(VoiceMail, XMPP)

Texting(SMS)

Instant Messaging(ICQ, MSN, Jabber)

Twitter

Enterprise Service Bus(ESB)

Dynamic OO Languages(eg Ruby)

Message Queuing(MQ)

Message Queuing(MQ)

What do wemean by

Messaging?

Page 37: StormMQ Introduction to AMQP, Dublin

Essential Terms

Message Queue What’s a Message?

Envelope

Payload

Header

Page 38: StormMQ Introduction to AMQP, Dublin

Essential Terms

*Strictly speaking

a receiver polls for messages

a consumer has messages pushed

≣ ≊Send Publish Enqueue

≣ ≊ DequeueConsume*Receive

Page 39: StormMQ Introduction to AMQP, Dublin

Connection

AMQP Client AMQP ServerTCP / IP Network

ConnectionVirtual Host

Connections and Channels

TLS “Shielding”

Channels

Each Channel is Independent:Effectively, a Virtual Connection

Page 40: StormMQ Introduction to AMQP, Dublin

Basic AMQP

Basic AMQP: Connections

Open a Connection to a Virtual Host

Open a Channel

Send a Message

Receive a Message

Close Channel

Close Connection

You only need one channel!

"

#

$

%

&

'

Page 41: StormMQ Introduction to AMQP, Dublin

Exchanges Route Messages

Exchanges route Messages to Message Queues

You send messages to an exchange, not a message queue

Exchange

MQ

A

MQ

B

Page 42: StormMQ Introduction to AMQP, Dublin

How do Exchanges Route?

Exchange

MQ

A

The Exchange finds a Bindingmatching the Routing Key#

A Binding connects a Routing Keyto one or more Message Queues

$Every sent message has a

Routing Key"

The Exchange delivers theMessage to the Message Queue%

A message queue can bebound more than once to

one or more exchanges(

“string”

Page 43: StormMQ Introduction to AMQP, Dublin

Types of Exchange

More rarely used exchange types include amq.headers and extensions

Message Queue Name

direct

Like a ‘Map’: All MQs bound with the

routing key receive copies of the message

“” (blank)amq.direct

fanout

Empty String

All MQs bound to the Exchange receive

copies of the message

amq.fanout

topic

Dotted

Bindings useglobbing expressions (wildcards) to route messages to MQs

amq.topic

A message queue can be bound more than once to an exchange;A message queue can be bound to more than one exchange

But a message queue will only receive a message sent once

Routing Key

RoutingBehaviour

Default Definitions

Point – to – Point One – to – Many Publish – SubscribeTypical Use

Page 44: StormMQ Introduction to AMQP, Dublin

And there is more!

Transactions

More Message Properties

Custom Message Properties

Immediate Delivery

Additional Exchange Types

Auto Deletion

Fine-Grained User Permissions

QueuePurging

QoS

Page 45: StormMQ Introduction to AMQP, Dublin

Agenda

Introduction to AMQP ! 20 min

Why Message Queuing? ! 25 min

Classic Architecture ! 10 min

A Real Application ! 20 min

Nibbles and Hands–On ! 60 min

Page 46: StormMQ Introduction to AMQP, Dublin

The Problem

Intrusion Detection

Lots of Logs

Firewall Monitoring

Performance & Failure

Page 47: StormMQ Introduction to AMQP, Dublin

What’s needed

Live Debugging Live Logging Live Statistics

Audit ComplianceStatistics Mining SMS Alerts EMail Alerts

Page 48: StormMQ Introduction to AMQP, Dublin

It must not get in the way

Add Hardware

Config

MaintenanceNo Extra Admins

Change Software

Page 49: StormMQ Introduction to AMQP, Dublin

Design of the Clients

intrusion

api.daemon.info.charon api.memory api.daemon.sshd api.warn

checksstatisticslog

Content-Type: application/json; charset=utf-8Timestamp: 2010-11-03T16:45:56.981ZPriority: Low / HighType: statistics_2011.10.01.1203Expiry: 5 mins

api.firewall.warn.in.portscan.tcp

Page 50: StormMQ Introduction to AMQP, Dublin

checks

Handling Log Messages

api.*.*.warn Queue

#Queue

Timestamp

No Acks

QoS Prefetch

WebSockets

logMessageId

Routing Key

*.warnQueue

checks

Stat

istics

Arc

hitect

ure

is th

e Sa

me

Page 51: StormMQ Introduction to AMQP, Dublin

From Checks to Alerts

#Queue

emergencyQueue

#Queue

checks

alerts

alerts

Contact Detailsnot in message

Message Aggregation /Suppression by alerts

Uses MessagePriority

Page 52: StormMQ Introduction to AMQP, Dublin

And debugging ?

Page 53: StormMQ Introduction to AMQP, Dublin

A-MQPAdvanced Message Queue Protocol

And debugging ?