+ All Categories
Home > Documents > Building Large Scale Distributed Systems with...

Building Large Scale Distributed Systems with...

Date post: 18-Feb-2020
Category:
Upload: others
View: 6 times
Download: 0 times
Share this document with a friend
59
Building Large Scale Distributed Systems with AMQP Ted Ross [email protected]
Transcript
Page 1: Building Large Scale Distributed Systems with AMQParchive.apachecon.com/na2013/presentations/26... · AMQP and MOM AMQP Came from the Messaging Oriented Middleware (MOM) World –

Building Large Scale Distributed Systems with

AMQP

Ted Ross [email protected]

Page 2: Building Large Scale Distributed Systems with AMQParchive.apachecon.com/na2013/presentations/26... · AMQP and MOM AMQP Came from the Messaging Oriented Middleware (MOM) World –

Agenda● What is AMQP?● Why is AMQP important to large distributed

enterprises?● How is the Apache Community making

AMQP a reality?● Wrap-up and Questions

Page 3: Building Large Scale Distributed Systems with AMQParchive.apachecon.com/na2013/presentations/26... · AMQP and MOM AMQP Came from the Messaging Oriented Middleware (MOM) World –

What You will Take Away

● AMQP is More Than Messaging● AMQP is Complex and Capable● Apache Makes AMQP Accessible and

Easy to Use● The Apache Software Foundation is on the

Cutting Edge of Distributed Computing

Page 4: Building Large Scale Distributed Systems with AMQParchive.apachecon.com/na2013/presentations/26... · AMQP and MOM AMQP Came from the Messaging Oriented Middleware (MOM) World –

Your Presenter● Ted Ross

Managing Principal Software EngineerRed Hat Inc. (Westford, MA)PMC Member and Committer

● Apache Qpid projectMRG-M product

● Background in Computer Networking and Network Security

Page 5: Building Large Scale Distributed Systems with AMQParchive.apachecon.com/na2013/presentations/26... · AMQP and MOM AMQP Came from the Messaging Oriented Middleware (MOM) World –

What is AMQP● Advanced Message Queuing Protocol

“Open Internet Protocol for Business Messaging”http://www.amqp.org

● Developed– By Users and Vendors– In Financial Services and Other Industry

Verticals– To address lock-in from proprietary

messaging systems

Page 6: Building Large Scale Distributed Systems with AMQParchive.apachecon.com/na2013/presentations/26... · AMQP and MOM AMQP Came from the Messaging Oriented Middleware (MOM) World –

AMQP and MOM● AMQP Came from the Messaging Oriented

Middleware (MOM) World– Early Versions based on Client and Broker,

Defined Broker Behavior

● AMQP 1.0 is Symmetric and Mostly Silent on Broker Behavior

● AMQP is More than Messaging...

Page 7: Building Large Scale Distributed Systems with AMQParchive.apachecon.com/na2013/presentations/26... · AMQP and MOM AMQP Came from the Messaging Oriented Middleware (MOM) World –

Protocols and APIs

Protocol

API API

Application Application

Page 8: Building Large Scale Distributed Systems with AMQParchive.apachecon.com/na2013/presentations/26... · AMQP and MOM AMQP Came from the Messaging Oriented Middleware (MOM) World –

Protocols and APIs

HTTP

REST WebServer/CGI

Application Application

Page 9: Building Large Scale Distributed Systems with AMQParchive.apachecon.com/na2013/presentations/26... · AMQP and MOM AMQP Came from the Messaging Oriented Middleware (MOM) World –

Protocols and APIs

<proprietary>

JMS JMS

Application Application

Page 10: Building Large Scale Distributed Systems with AMQParchive.apachecon.com/na2013/presentations/26... · AMQP and MOM AMQP Came from the Messaging Oriented Middleware (MOM) World –

Protocols and APIs

<proprietary>

JMS JMS

Application Application

Broker

Page 11: Building Large Scale Distributed Systems with AMQParchive.apachecon.com/na2013/presentations/26... · AMQP and MOM AMQP Came from the Messaging Oriented Middleware (MOM) World –

Protocols and APIs

<proprietary>

JMS (vendor A) JMS (vendor B)

Application Application

Broker(vendor A)

<proprietary> X

Page 12: Building Large Scale Distributed Systems with AMQParchive.apachecon.com/na2013/presentations/26... · AMQP and MOM AMQP Came from the Messaging Oriented Middleware (MOM) World –

Protocols and APIs

AMQP

JMS (vendor A) JMS (vendor B)

Application Application

Broker(vendor A)

Page 13: Building Large Scale Distributed Systems with AMQParchive.apachecon.com/na2013/presentations/26... · AMQP and MOM AMQP Came from the Messaging Oriented Middleware (MOM) World –

Protocols and APIs

AMQP

JMS Qpid .NET

Application Application

Broker

Page 14: Building Large Scale Distributed Systems with AMQParchive.apachecon.com/na2013/presentations/26... · AMQP and MOM AMQP Came from the Messaging Oriented Middleware (MOM) World –

Protocols and APIs

AMQP

JMS Qpid .NET

Application Application

Page 15: Building Large Scale Distributed Systems with AMQParchive.apachecon.com/na2013/presentations/26... · AMQP and MOM AMQP Came from the Messaging Oriented Middleware (MOM) World –

Protocols to Contrast● HTTP● SMTP● STOMP● MQTT● ...

Page 16: Building Large Scale Distributed Systems with AMQParchive.apachecon.com/na2013/presentations/26... · AMQP and MOM AMQP Came from the Messaging Oriented Middleware (MOM) World –

AMQP Anatomy

Connection

Page 17: Building Large Scale Distributed Systems with AMQParchive.apachecon.com/na2013/presentations/26... · AMQP and MOM AMQP Came from the Messaging Oriented Middleware (MOM) World –

AMQP Anatomy

Connection

● Reliable Transport Connection– TCP, RDMA over Infiniband/10GigE, etc.

– Transport-Level Security (SSL/TLS, SASL)

Page 18: Building Large Scale Distributed Systems with AMQParchive.apachecon.com/na2013/presentations/26... · AMQP and MOM AMQP Came from the Messaging Oriented Middleware (MOM) World –

AMQP Anatomy

Connection

Session

Session

Page 19: Building Large Scale Distributed Systems with AMQParchive.apachecon.com/na2013/presentations/26... · AMQP and MOM AMQP Came from the Messaging Oriented Middleware (MOM) World –

AMQP Anatomy

Connection

Session

Session

● Session Multiplexing● Interleaving of Message Flow

Page 20: Building Large Scale Distributed Systems with AMQParchive.apachecon.com/na2013/presentations/26... · AMQP and MOM AMQP Came from the Messaging Oriented Middleware (MOM) World –

AMQP Anatomy

Connection

Session

Session

Links

Page 21: Building Large Scale Distributed Systems with AMQParchive.apachecon.com/na2013/presentations/26... · AMQP and MOM AMQP Came from the Messaging Oriented Middleware (MOM) World –

AMQP Anatomy

Connection

Session

Session

Links

● Full Duplex Message Transfer● Asynchronous Message Transfer● Independent Flow Control

Page 22: Building Large Scale Distributed Systems with AMQParchive.apachecon.com/na2013/presentations/26... · AMQP and MOM AMQP Came from the Messaging Oriented Middleware (MOM) World –

Link

Message Transfer

Page 23: Building Large Scale Distributed Systems with AMQParchive.apachecon.com/na2013/presentations/26... · AMQP and MOM AMQP Came from the Messaging Oriented Middleware (MOM) World –

SourceNode

DestinationNode Link

Message Transfer

Page 24: Building Large Scale Distributed Systems with AMQParchive.apachecon.com/na2013/presentations/26... · AMQP and MOM AMQP Came from the Messaging Oriented Middleware (MOM) World –

SourceNode

DestinationNode Link

Message Handoff – Copy/Move

SourceNode

DestinationNode Link

Message Copy

Message Move

Page 25: Building Large Scale Distributed Systems with AMQParchive.apachecon.com/na2013/presentations/26... · AMQP and MOM AMQP Came from the Messaging Oriented Middleware (MOM) World –

SourceNode

DestinationNode Link

Settlement and Disposition

● Pre-Settled (Fire and Forget)● Settled with Disposition

– Accepted

– Rejected

– Released

Page 26: Building Large Scale Distributed Systems with AMQParchive.apachecon.com/na2013/presentations/26... · AMQP and MOM AMQP Came from the Messaging Oriented Middleware (MOM) World –

SourceNode

DestinationNode Link

Transactions

● Local Transaction● Distributed Transaction

Page 27: Building Large Scale Distributed Systems with AMQParchive.apachecon.com/na2013/presentations/26... · AMQP and MOM AMQP Came from the Messaging Oriented Middleware (MOM) World –

SourceNode

DestinationNode Link

Message Handoff – Flow Control

● Destination Issues Credit● Source Sends no more than <credit>

Deliveries● Flow Control is Independent from Settlement

credit=2

Page 28: Building Large Scale Distributed Systems with AMQParchive.apachecon.com/na2013/presentations/26... · AMQP and MOM AMQP Came from the Messaging Oriented Middleware (MOM) World –

Flow Control

DataCollectionSystem

A MultitudeOf

Data Sources

AMQP Links

Page 29: Building Large Scale Distributed Systems with AMQParchive.apachecon.com/na2013/presentations/26... · AMQP and MOM AMQP Came from the Messaging Oriented Middleware (MOM) World –

Summary of Benefits● Session Multiplexing● Full Duplex, Asynchronous Transfer● Formal Semantics of Message Hand-Off● Data Security● Flow Control● Serialization of Structured Data● Message Metadata

Page 30: Building Large Scale Distributed Systems with AMQParchive.apachecon.com/na2013/presentations/26... · AMQP and MOM AMQP Came from the Messaging Oriented Middleware (MOM) World –

Topologies - MOM

Endpoint EndpointAMQPIntermediary(Broker)

AMQP

Page 31: Building Large Scale Distributed Systems with AMQParchive.apachecon.com/na2013/presentations/26... · AMQP and MOM AMQP Came from the Messaging Oriented Middleware (MOM) World –

Topologies – Point to Point

Endpoint EndpointAMQP

Page 32: Building Large Scale Distributed Systems with AMQParchive.apachecon.com/na2013/presentations/26... · AMQP and MOM AMQP Came from the Messaging Oriented Middleware (MOM) World –

Topologies

Endpoint EndpointAMQPAMQPNetwork

orMessaging

Service

Page 33: Building Large Scale Distributed Systems with AMQParchive.apachecon.com/na2013/presentations/26... · AMQP and MOM AMQP Came from the Messaging Oriented Middleware (MOM) World –

AMQP Network

router

proxy proxy proxy

proxyproxy

broker

router

router router

?

Page 34: Building Large Scale Distributed Systems with AMQParchive.apachecon.com/na2013/presentations/26... · AMQP and MOM AMQP Came from the Messaging Oriented Middleware (MOM) World –

AMQP Router

RouterNode

Links toOtherRouters

Links toConnectedEndpoints

● Tracks Locally Connected Endpoints● Can Assign Temporary Addresses● Shares Address Information with Other

Routers

Routing Table

Page 35: Building Large Scale Distributed Systems with AMQParchive.apachecon.com/na2013/presentations/26... · AMQP and MOM AMQP Came from the Messaging Oriented Middleware (MOM) World –

AMQP Proxy

ProxyNode

● Ties a “public-facing” link to an Internal Link● Policy Enforcement at Link Setup Time● Renaming of Link Target/Source may Occur● Delivery Transfer is Very Simple

Link to/from Endpoint Link into Network

Page 36: Building Large Scale Distributed Systems with AMQParchive.apachecon.com/na2013/presentations/26... · AMQP and MOM AMQP Came from the Messaging Oriented Middleware (MOM) World –

Use Case● Public Service Delivery over AMQP

– Hardened Proxies● Enforce Access Policy● Provide Multi-Tennancy● Resist Denial-of-Service

– Routers● Provide Redundancy and Scaling

– Brokers● Provide Queuing, Persistence, etc.

Page 37: Building Large Scale Distributed Systems with AMQParchive.apachecon.com/na2013/presentations/26... · AMQP and MOM AMQP Came from the Messaging Oriented Middleware (MOM) World –

This is Complicated

How Do I Use It?

Page 38: Building Large Scale Distributed Systems with AMQParchive.apachecon.com/na2013/presentations/26... · AMQP and MOM AMQP Came from the Messaging Oriented Middleware (MOM) World –

AMQP in Messaging Systems● Apache ActiveMQ

– Multi-protocol Java Message Broker

– Includes AMQP Transport

● Apache Qpid– AMQP Brokers (Native and Java)

– AMQP Clients● Native, Java JMS/JCA, .NET● C++, Java, Python, Ruby, Perl, PHP, *.NET

Page 39: Building Large Scale Distributed Systems with AMQParchive.apachecon.com/na2013/presentations/26... · AMQP and MOM AMQP Came from the Messaging Oriented Middleware (MOM) World –

AMQP in Your Systems● Qpid Proton

– Intended for Embedding and Integration

– Implementation of the AMQP Protocol

– C, Java, Javascript

– Messenger API with script language wrappers

● Qpid Dispatch– Event-Driven, Multi-Threaded container for

Proton

Page 40: Building Large Scale Distributed Systems with AMQParchive.apachecon.com/na2013/presentations/26... · AMQP and MOM AMQP Came from the Messaging Oriented Middleware (MOM) World –

Qpid Proton

DriverEngine Transport I/O

● Driver– Provides I/O

– Defines Threading Model

● Engine– State Machine

– Non-Blocking API

Page 41: Building Large Scale Distributed Systems with AMQParchive.apachecon.com/na2013/presentations/26... · AMQP and MOM AMQP Came from the Messaging Oriented Middleware (MOM) World –

Qpid Proton

DriverEngine Transport I/O

● Proton Messenger– Easy to Use Messaging API for Developers

– Hides many Details of AMQP

Messenger

Page 42: Building Large Scale Distributed Systems with AMQParchive.apachecon.com/na2013/presentations/26... · AMQP and MOM AMQP Came from the Messaging Oriented Middleware (MOM) World –

Integrating over Messenger

DriverEngine Transport I/O

Messenger

Your Application/API/Bridge/etc.

Page 43: Building Large Scale Distributed Systems with AMQParchive.apachecon.com/na2013/presentations/26... · AMQP and MOM AMQP Came from the Messaging Oriented Middleware (MOM) World –

Integrating over Engine

DriverEngine Transport I/O

Your Application/API/Bridge/etc.

● The “Red Pill”● When you need control over every aspect

of AMQP● Significantly more complex

Page 44: Building Large Scale Distributed Systems with AMQParchive.apachecon.com/na2013/presentations/26... · AMQP and MOM AMQP Came from the Messaging Oriented Middleware (MOM) World –

Qpid Dispatch● Goals

– Aid in Integration over Proton Engine

– Provide a framework for development of AMQP infrastructure

– Simple intermediaries that can fully utilize expensive network infrastructure

● Multi-Threaded Event-Driven Container

Page 45: Building Large Scale Distributed Systems with AMQParchive.apachecon.com/na2013/presentations/26... · AMQP and MOM AMQP Came from the Messaging Oriented Middleware (MOM) World –

Qpid Dispatch Architecture

DriverProton Engine Transport I/O

SERVER

CONTAINER

ROUTER

MESSAGE

Page 46: Building Large Scale Distributed Systems with AMQParchive.apachecon.com/na2013/presentations/26... · AMQP and MOM AMQP Came from the Messaging Oriented Middleware (MOM) World –

Qpid Dispatch - Server

DriverProton Engine

SERVER

CONTAINER

ROUTERMESSAGE

● AMQP Connections– Listeners

– Resilient Connectors

● Timers● Thread Control (quiesce/resume, etc.)● Management of non-AMQP FDs● Handling of Signals

Page 47: Building Large Scale Distributed Systems with AMQParchive.apachecon.com/na2013/presentations/26... · AMQP and MOM AMQP Came from the Messaging Oriented Middleware (MOM) World –

Qpid Dispatch - Container

DriverProton Engine

SERVER

CONTAINER

ROUTERMESSAGE

● API for Node Creation● Manages Node Lifecycle● Handles Links and Deliveries

– Link attach/detach

– Delivery inbound/outbound

– Disposition and Settlement

– Flow Control

Page 48: Building Large Scale Distributed Systems with AMQParchive.apachecon.com/na2013/presentations/26... · AMQP and MOM AMQP Came from the Messaging Oriented Middleware (MOM) World –

Qpid Dispatch - Message

DriverProton Engine

SERVER

CONTAINER

ROUTERMESSAGE

● API for Message Manipulation– Fixed-size buffer chaining

– Access to fields regardless of buffer boundaries

– Parses message contents only as far as needed

– Efficiently handles modified annotations

Page 49: Building Large Scale Distributed Systems with AMQParchive.apachecon.com/na2013/presentations/26... · AMQP and MOM AMQP Came from the Messaging Oriented Middleware (MOM) World –

Qpid Dispatch - Router

DriverProton Engine

SERVER

CONTAINER

ROUTERMESSAGE

● Tracks Consumers by Address● Forwards Messages from

Inbound Link to Outbound Linkby Address

● Supports Internal and External Endpoints● Interacts with Other Routers to Compute

Paths across Networks

Page 50: Building Large Scale Distributed Systems with AMQParchive.apachecon.com/na2013/presentations/26... · AMQP and MOM AMQP Came from the Messaging Oriented Middleware (MOM) World –

Future Work● Configuration● Agent for Remote Management● Proxy Node

Page 51: Building Large Scale Distributed Systems with AMQParchive.apachecon.com/na2013/presentations/26... · AMQP and MOM AMQP Came from the Messaging Oriented Middleware (MOM) World –

Qpid Dispatch● Sub-Project of Apache Qpid

svn: qpid/trunk/qpid/extras/dispatch

● Installed Artifactsinclude/qpid/dispatch/*.hlib/libqpid-dispatch.sobin/dispatch-router

● Web Site– Content will appear after the release of Qpid

0.22 (End of March)

Page 52: Building Large Scale Distributed Systems with AMQParchive.apachecon.com/na2013/presentations/26... · AMQP and MOM AMQP Came from the Messaging Oriented Middleware (MOM) World –

Summary of Apache Projects

ProjectProject VersionVersion MaturityMaturity

Apache ActiveMQ 5.8 Mature

Apache Qpid 0.20 Mature

Qpid Proton 0.4 Emerging

Qpid Dispatch unreleased New

Page 53: Building Large Scale Distributed Systems with AMQParchive.apachecon.com/na2013/presentations/26... · AMQP and MOM AMQP Came from the Messaging Oriented Middleware (MOM) World –

What You will Take Away

● AMQP is More Than Messaging● AMQP is Complex and Capable● Apache Makes AMQP Accessible and

Easy to Use● The Apache Software Foundation is on the

Cutting Edge of Distributed Computing

Page 54: Building Large Scale Distributed Systems with AMQParchive.apachecon.com/na2013/presentations/26... · AMQP and MOM AMQP Came from the Messaging Oriented Middleware (MOM) World –

Questions and Discussion

Page 55: Building Large Scale Distributed Systems with AMQParchive.apachecon.com/na2013/presentations/26... · AMQP and MOM AMQP Came from the Messaging Oriented Middleware (MOM) World –

Bonus Material

Page 56: Building Large Scale Distributed Systems with AMQParchive.apachecon.com/na2013/presentations/26... · AMQP and MOM AMQP Came from the Messaging Oriented Middleware (MOM) World –

SourceNode

DestinationNode Link

Message Handoff

● Message and Delivery are Separate– “Letter” and “Envelope”

– Same message may be delivered to multiple destinations or redelivered to the same destination

Page 57: Building Large Scale Distributed Systems with AMQParchive.apachecon.com/na2013/presentations/26... · AMQP and MOM AMQP Came from the Messaging Oriented Middleware (MOM) World –

SourceNode

DestinationNode Link

Link and Message Address

Link Target Link Source

To:

Page 58: Building Large Scale Distributed Systems with AMQParchive.apachecon.com/na2013/presentations/26... · AMQP and MOM AMQP Came from the Messaging Oriented Middleware (MOM) World –

SourceNode

DestinationNode Link

Source Filters

Source Filter

Page 59: Building Large Scale Distributed Systems with AMQParchive.apachecon.com/na2013/presentations/26... · AMQP and MOM AMQP Came from the Messaging Oriented Middleware (MOM) World –

Message Structure

headerdelivery

annotationmessage

annotationproperties app

propertiesdata footer

● Data may be in any Format including AMQP-formatted data

● Structured Properties and Annotations

● Security– Bare Message may be signed/encrypted

– CRC/Signature in footer for efficiency


Recommended