SlideShare uma empresa Scribd logo
1 de 32
Beyond REST and RPC:
Asynchronous Eventing and
Messaging Patterns
Clemens Vasters
Principal Architect – Azure Messaging, Microsoft
@clemensv
OASIS AMQP Technical Committee Chair
OASIS MQTT TC Member
CNCF CloudEvents Architect
OPC UA PubSub Architect
Agenda
• Asynchronous Communication Patterns
• Principles and Standards
• Projects, Products, and Services
Demo ;)
m = new Message(
Encoding.UTF8.GetBytes("Hello!"));
await sender.SendAsync( );
receiver.RegisterMessageHandler( ( ) => {
Console.WriteLine(
Encoding.UTF8.GetString(m.Body));
});
do
{
m = receiver.Receive( );
if ( m != null )
{
Console.WriteLine(
Encoding.UTF8.GetString(m.Body));
}
} while ( m != null );
m
m
m
mmm
Patterns
Synchronous vs. Asynchronous
• Sender sends request and then waits for an
immediate answer
• May happen via asynchronous I/O, but the
logical thread is preserved.
• Correlation between request and reply is
typically implicit, by order of requests.
• Errors typically flow back on the same path.
• Sender sends a message and proceeds to do
other things.
• Replies may flow back on a separate path.
• Messages may be stored by intermediaries.
• Message delivery may be attempted multiple
times.
• …
ReceiverSender ReceiverSender
Interaction duration:
Microseconds to seconds
Interaction duration:
Microseconds to years
One-Way!?!
• Asynchronous flows are
generally one-way.
• The producer gets no initial
answer other than the
message having been
accepted into the
queue/buffer.
• Remain seated. Stay calm!
• Reply and error channels are
explicit.
• Correlation is flexible.
Multiple replies may refer to
one message.
ConsumerProducer
in reply to
Pull
One-way reply channel(s)
One-way error channel
Push
Long-RunningWork
• Processing at the consumer may
take very long (minutes to hours)
• Processing at the consumer may
require reliable, one-time outcomes
(like execution of payments).
• Producers entrust jobs into a queue.
• Consumers negotiate the outcome,
including any required retries due to
intermittent failures with the queue
• Bad jobs are moved into a dead-
letter queue for inspection.
• Flow back to the producer is
performed through a reply queue
ConsumerProducer
correlationid:
reply queue
replyto:
dead-letter queue
Retry 1
Retry 2
Load Leveling
• Queues/buffers act as an
inbox for requests to a
consumer.
• Push/pull translation:
Consumer pulls work when
it has capacity for
processing.
• Consumer processes at its
own pace, without ever
getting overloaded.
• No “too busy” errors, easier
resource governance.
Consumer
Producer
Producer
Producer
Producer
Producer
requests/sec
time
requests/sec
time
processing capacity
Load Balancing and Auto Scaling
• Multiple consumers
compete for messages
• Each consumer only pulls
work when it has capacity
for processing.
• Truly load-aware job
balancing
• Queue-length can be
observed; if rolling average
crosses a threshold, more
consumers can be added to
auto-scale based on true
load.
Consumer
Producer
Producer
Producer
Producer
Producer
queue length rolling average
time
scale-up threshold
scale-down threshold
+1
Consumer
Consumer
Publish-Subscribe
• Directing one input
message to zero or more
interested parties
(subscribers).
• Every subscriber has the
opportunity to obtain a
copy of every published
message.
• Subscribers can often
provide filters that select a
subset of the published
messages.
ConsumerProducer 2 4 6
1 2 3
1 3 5
Topic filter
filter
filter
Consumer
Consumer
Partitioning
• Partitioning is not the same as
publish-subscribe
• Partitions are chosen while
publishing, not while subscribing
• Partitioning serves to subdivide a
stream such that
• it can be stored reliably if the
volume is enormous
• it can be processed with multiple
consumers in parallel and without
overlaps
• Pub-Sub can compose with
partitioning by letting subscribers
choose partition subsets.
ConsumerProducer b b b
a a a
c c c
Stream
Consumer
Consumer
hash()
Partition 1
Partition 2
Partition 3
Multiplexing with Exclusive Consumers
• Multiplexing funnels sequences of
related messages concurrently
through one route.
• Exclusive consumers snap to
sequences and the queue
guarantees consistent routing of
messages to the same consumer.
• Provides first-in-first-out assurance
on a per-sequence basis.
• Can be provided without head-of-
line blocking, i.e. each sequence
acts like an independent sub-queue.
• Often used with scenarios where
huge numbers of contexts must be
handled, e.g. in workflow
processing.
Consumer
Producer
Producer
Producer
Consumer
Consumer
Consumer
Partition 1
Consumer
Partition 3
Stateful Processing
• Stateful processing is simplified
by pulling a stream stepwise
towards a state aggregator (like
calculating a rolling average).
• Consumption can be easily
suspended, the state moved, and
consumption resumed elsewhere
when needed.
Consumer
State
A+B+C
A B CProducer
Sparse Connectivity
• Sparse connectivity is common
with wireless applications,
including IoT edge applications.
• Mobile users switch networks, go
out of range, hit bandwidth caps,
etc.
• Mobile applications get frequently
suspended.
• You can make communication
paths more robust by making
them strictly async and using a
local store/forward queue setup.
Consumer
Producer
Push
Pull
store and forward queue
Unreliable network boundary, e.g. mobile wireless networking
move messages
while online
Edge
Cloud
App App App
Pub-Sub State Synchronization
App App
∑
Telemetry Capture for Analytics
∑
App
Fn
Business Workflow Coordination
FnApp
DHCP, NAT, Firewalls
Composite Edge and Cloud Patterns
e.g. “Digital Twin“ Cloud Analytics
Broker Broker Broker
App
Protocols
Azure
Messaging
Protocol
Principles
• Protocols we prefer must be vendor-neutral, have a
formal definition independent of any implementation,
and must be under neutral governance.
• We prefer formal standardization venues such that
standards can be composed and be the basis of formal
certification programs:W3C, OASIS, IETF, ISO, IEC
• Multiple, competing implementations of the full
protocol feature range must exist, not just clients.
• Protocols must be secure, integrate with federated
authorization models, and be compatible with common
enterprise network policy practices.
• Protocols must fit the target scenario and not require
product-specific extensions for the scenario to work.
Still, they must be extensible to allow for backwards-
compatible evolution in the context of standards
collaboration.
Azure
Messaging
Protocol
Pillars
• IETF HTTPS & WebSocket Protocol
• Request-response application protocol
• Azure Services: Azure Event Hubs,Azure Service Bus,Azure EventGrid, Azure
Relay, Azure IoT Hub
• OASIS AMQP 1.0
• Vendor-independent and product-independent, symmetric, reliable message
transfer protocol with support for multiplexing and flow control
• Azure Services: Azure Event Hubs,Azure Service Bus,Azure IoT Hub
• OSS: ApacheActiveMQ Classic, ApacheActiveMQ Artemis, Apache Qpid Broker-J,
Apache QpidC++,Apache Qpid Dispatch Router, Apache Camel, CNCF Strimzi
Bridge, Eclipse Hono, Eclipse Ditto, Pivotal RabbitMQ
• OASIS MQTT 3.x/5.x
• Vendor-independent and product-independent, reliable publish-subscribe
protocol for telemetry transfer and state synchronization
• Azure Services: Azure IoT Hub
• OSS: Apache ActiveMQ Classic, Apache ActiveMQ Artemis, Eclipse Hono, Pivotal
RabbitMQ, Eclipse Mosquitto, HiveMQ,VerneMQ, etc.
• CNCF CloudEvents
• Vendor-independent and product-independent event data model with multiple
bindings to protocols and encodings
• Azure Services: Azure EventGrid, Azure Service Bus and Event Hubs via AMQP
• We support other protocols as needed, in order to meet customers where they are.
Some Interop Options with AMQP and MQTT
Dispatch Router
Eclipse Hono
IoT Connectivity Platform
Azure IoT Hub
Apache ActiveMQ
Eclipse Mosquitto RabbitMQ
w/ AMQP 1.0 plugin
Azure Service Bus
Azure Event Hubs
Eclipse Ditto Twins
Apache Camel
CNCF Strimzi
MQTT
MQTT
MQTT
MQTT/AMQP
MQTT/AMQP
AMQP
AMQP
AMQP
AMQP
AMQP
App
App
App
App
App
App
App
App
App
AMQP
AMQP
AMQP
AMQP
Edge
Azure Cloud
App App App
Pub-Sub State Synchronization
(MQTT, AMQP)
App App
∑
Telemetry Capture for Analytics
(Kafka, AMQP)
∑
App
Fn
Business Workflow Coordination
(AMQP, HTTP)
Fn
App
DHCP, NAT, Firewalls
Service Bus
Service BusEvent Hubs Service Bus
Apache ActiveMQ
CNCF Strimzi
RabbitMQ
w/ AMQP 1.0 plugin
Edge/cloud federation examples
Dispatch Router Dispatch Router
RabbitMQ
Shovel
Azure Service
Bus
Cross-Site/Cross-Region Federation
with Apache Qpid Dispatch
Dispatch Router
Apache ActiveMQ
RabbitMQ
w/ AMQP 1.0 plugin
Azure Service Bus
Apache ActiveMQ
RabbitMQ
w/ AMQP 1.0 plugin
Azure Service Bus
Azure Event Hubs
CNCF Strimzi
Azure Services
Azure Messaging Suite
Azure Service
Bus
Azure Event
Hubs
Azure Event
Grid
Azure Relay
Why four services?Very different patterns.
Event Grid
Push-style distribution of
discrete events to serverless
workloads
Service Bus
Pull-style, queue-based transfer of
jobs and control via message queues
and topics
Event Hubs
Partitioned, high-volume, tape-drive-
style sequential recording and
unlimited, pull-style re-reads of event
streams.
Relay
Discovery and connectivity service for
securely bridging streams across network
boundaries in hybrid edge/cloud scenarios.
Message
Oriented
Services
Connectivity
Services
HTTP
AMQP/WS
HTTP
AMQP/WS
KRPC
HTTP
(AMQP/WS)
WS
Event Hubs Architectural Patterns
Event Hubs is a high-scale, high-availability, multi-protocol event stream engine used for collecting and consolidating
events for real-time analytics and other high-throughput computations
Event Hub
◦ Ingestion and storage of large event streams
◦ > 2 Gigabyte per second if required
◦ Separation of event streams into partitions
◦ Client-chosen offsets into event stream allow arbitrary reads and
re-reads during retention
◦ Retention of raw event data from 1 up to 90 days
◦ Automated archival into Avro containers for subsequent batch-
style processing
◦ Publisher policies for data origin attestation and access control
◦ Supports the Apache Kafka™ producer and consumer wire
protocol to meet customers where they are
HTTP
AMQP/WS
KRPC (Kafka)
Service Bus Architectural Patterns
Service Bus is a “swiss army knife” for messaging-driven workloads.
Queues
Topics
◦ Assignment of work with load-aware balancing
◦ Load-leveling for “spiky” workload traffic shapes
◦ Transactional, once-and-only-once processing
◦ Multiplex handling of in-order message sequences
◦ Deduplication, deferral, and “poison” handling
◦ All of the above, plus:
◦ Copies to 100s of concurrent subscribers
◦ Filter rules and message markup
◦ Message routing
HTTP
AMQP/WS
HTTP
AMQP/WS
Event Grid Architectural Patterns
Event Grid is the Azure-wide eventing backplane for distributing and handling discrete events raised at the platform
level, by custom applications, and by partner platforms.
Event Grid
◦ Ingestion and push-style distribution of discrete events
(events not correlated into streams) to interested
subscribers.
◦ Per-subscriber application of simple and complex filters to
select particular events of interest
◦ Abuse protection for event publishers
◦ Event schema mapping and support for CNCFCloudEvents
1.0 standard and bindings
◦ Multitenancy support for SaaS applications.
◦ Simple integration with a catalog of available event sources
and sinks.
HTTP
AMQP/WS
Buffered Communication and Queues
• Producers push messages in,
consumers pull messages out.
• Producers and consumers maintain
independent security relationships with
the intermediary.
• Producers and consumers are
temporally decoupled.
• Order of arrival typically determines
order of delivery
• Queues manage which messages to
deliver next. Buffers leave that to the
client.
• Most network communication is queue-
based, at multiple levels:
• Dispatch queues
• Thread pool queues
• Packet transfer queues
ConsumerProducer
Push
Pull
One-way flow!
RelayArchitectural patterns
• Expose (micro-) services, databases,
and other endpoints from private
networks on a public network
endpoint without requiringVPN
connectivity and/or DNS integration.
• Ad-hoc discovery of endpoints with
dynamic network addresses
• Firewall and NAT traversal for one or
both communicating parties
• Endpoint-level bridging across Azure
VNet
• “Azure Bridge” runtime allows for
bridging UDP,TCP, and Unix sockets
Relay
WS
Thanks for joining !
@clemensv
https://docs.microsoft.com/azure/messaging-services/
© 2020 Microsoft Corporation. All rights reserved. The text in this document is available under the Creative Commons Attribution 3.0 License, additional terms may apply. All other content contained in this document
(including, without limitation, trademarks, logos, images, etc.) are not included within the Creative Commons license grant. This document does not provide you with any legal rights to any intellectual property in any
Microsoft product. You may copy and use this document for your internal, reference purposes.
This document is provided "as-is." Information and views expressed in this document, including URL and other Internet Web site references, may change without notice. You bear the risk of using it. Some examples are for
illustration only and are fictitious. No real association is intended or inferred. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Mais conteúdo relacionado

Mais procurados

Kafka on Kubernetes: Keeping It Simple (Nikki Thean, Etsy) Kafka Summit SF 2019
Kafka on Kubernetes: Keeping It Simple (Nikki Thean, Etsy) Kafka Summit SF 2019Kafka on Kubernetes: Keeping It Simple (Nikki Thean, Etsy) Kafka Summit SF 2019
Kafka on Kubernetes: Keeping It Simple (Nikki Thean, Etsy) Kafka Summit SF 2019confluent
 
OAuth2 - Introduction
OAuth2 - IntroductionOAuth2 - Introduction
OAuth2 - IntroductionKnoldus Inc.
 
Deep Dive into Apache Kafka
Deep Dive into Apache KafkaDeep Dive into Apache Kafka
Deep Dive into Apache Kafkaconfluent
 
OAuth2 and Spring Security
OAuth2 and Spring SecurityOAuth2 and Spring Security
OAuth2 and Spring SecurityOrest Ivasiv
 
NATS Streaming - an alternative to Apache Kafka?
NATS Streaming - an alternative to Apache Kafka?NATS Streaming - an alternative to Apache Kafka?
NATS Streaming - an alternative to Apache Kafka?Anton Zadorozhniy
 
Confluent REST Proxy and Schema Registry (Concepts, Architecture, Features)
Confluent REST Proxy and Schema Registry (Concepts, Architecture, Features)Confluent REST Proxy and Schema Registry (Concepts, Architecture, Features)
Confluent REST Proxy and Schema Registry (Concepts, Architecture, Features)Kai Wähner
 
Kafka Streams for Java enthusiasts
Kafka Streams for Java enthusiastsKafka Streams for Java enthusiasts
Kafka Streams for Java enthusiastsSlim Baltagi
 
Microservices design patterns
Microservices design patternsMicroservices design patterns
Microservices design patternsMasashi Narumoto
 
Apache Bookkeeper and Apache Zookeeper for Apache Pulsar
Apache Bookkeeper and Apache Zookeeper for Apache PulsarApache Bookkeeper and Apache Zookeeper for Apache Pulsar
Apache Bookkeeper and Apache Zookeeper for Apache PulsarEnrico Olivelli
 
Introduction To Confluence
Introduction To ConfluenceIntroduction To Confluence
Introduction To ConfluenceHua Soon Sim
 
Deploying Flink on Kubernetes - David Anderson
 Deploying Flink on Kubernetes - David Anderson Deploying Flink on Kubernetes - David Anderson
Deploying Flink on Kubernetes - David AndersonVerverica
 
Performance Tuning Oracle Weblogic Server 12c
Performance Tuning Oracle Weblogic Server 12cPerformance Tuning Oracle Weblogic Server 12c
Performance Tuning Oracle Weblogic Server 12cAjith Narayanan
 
Your Path to HCL Nomad Web goes from Domino through SafeLinx
Your Path to HCL Nomad Web goes from Domino through SafeLinxYour Path to HCL Nomad Web goes from Domino through SafeLinx
Your Path to HCL Nomad Web goes from Domino through SafeLinxpanagenda
 
Developing Kafka Streams Applications with Upgradability in Mind with Neil Bu...
Developing Kafka Streams Applications with Upgradability in Mind with Neil Bu...Developing Kafka Streams Applications with Upgradability in Mind with Neil Bu...
Developing Kafka Streams Applications with Upgradability in Mind with Neil Bu...HostedbyConfluent
 
Consistency and Completeness: Rethinking Distributed Stream Processing in Apa...
Consistency and Completeness: Rethinking Distributed Stream Processing in Apa...Consistency and Completeness: Rethinking Distributed Stream Processing in Apa...
Consistency and Completeness: Rethinking Distributed Stream Processing in Apa...Guozhang Wang
 
Introduction To RabbitMQ
Introduction To RabbitMQIntroduction To RabbitMQ
Introduction To RabbitMQKnoldus Inc.
 

Mais procurados (20)

Kafka 101
Kafka 101Kafka 101
Kafka 101
 
Kafka on Kubernetes: Keeping It Simple (Nikki Thean, Etsy) Kafka Summit SF 2019
Kafka on Kubernetes: Keeping It Simple (Nikki Thean, Etsy) Kafka Summit SF 2019Kafka on Kubernetes: Keeping It Simple (Nikki Thean, Etsy) Kafka Summit SF 2019
Kafka on Kubernetes: Keeping It Simple (Nikki Thean, Etsy) Kafka Summit SF 2019
 
Chaos Engineering
Chaos EngineeringChaos Engineering
Chaos Engineering
 
OAuth2 - Introduction
OAuth2 - IntroductionOAuth2 - Introduction
OAuth2 - Introduction
 
Deep Dive into Apache Kafka
Deep Dive into Apache KafkaDeep Dive into Apache Kafka
Deep Dive into Apache Kafka
 
OAuth2 and Spring Security
OAuth2 and Spring SecurityOAuth2 and Spring Security
OAuth2 and Spring Security
 
NATS Streaming - an alternative to Apache Kafka?
NATS Streaming - an alternative to Apache Kafka?NATS Streaming - an alternative to Apache Kafka?
NATS Streaming - an alternative to Apache Kafka?
 
Confluent REST Proxy and Schema Registry (Concepts, Architecture, Features)
Confluent REST Proxy and Schema Registry (Concepts, Architecture, Features)Confluent REST Proxy and Schema Registry (Concepts, Architecture, Features)
Confluent REST Proxy and Schema Registry (Concepts, Architecture, Features)
 
Kafka Streams for Java enthusiasts
Kafka Streams for Java enthusiastsKafka Streams for Java enthusiasts
Kafka Streams for Java enthusiasts
 
Microservices design patterns
Microservices design patternsMicroservices design patterns
Microservices design patterns
 
Apache Bookkeeper and Apache Zookeeper for Apache Pulsar
Apache Bookkeeper and Apache Zookeeper for Apache PulsarApache Bookkeeper and Apache Zookeeper for Apache Pulsar
Apache Bookkeeper and Apache Zookeeper for Apache Pulsar
 
Introduction To Confluence
Introduction To ConfluenceIntroduction To Confluence
Introduction To Confluence
 
Patterns of resilience
Patterns of resiliencePatterns of resilience
Patterns of resilience
 
Deploying Flink on Kubernetes - David Anderson
 Deploying Flink on Kubernetes - David Anderson Deploying Flink on Kubernetes - David Anderson
Deploying Flink on Kubernetes - David Anderson
 
Performance Tuning Oracle Weblogic Server 12c
Performance Tuning Oracle Weblogic Server 12cPerformance Tuning Oracle Weblogic Server 12c
Performance Tuning Oracle Weblogic Server 12c
 
Mutiny + quarkus
Mutiny + quarkusMutiny + quarkus
Mutiny + quarkus
 
Your Path to HCL Nomad Web goes from Domino through SafeLinx
Your Path to HCL Nomad Web goes from Domino through SafeLinxYour Path to HCL Nomad Web goes from Domino through SafeLinx
Your Path to HCL Nomad Web goes from Domino through SafeLinx
 
Developing Kafka Streams Applications with Upgradability in Mind with Neil Bu...
Developing Kafka Streams Applications with Upgradability in Mind with Neil Bu...Developing Kafka Streams Applications with Upgradability in Mind with Neil Bu...
Developing Kafka Streams Applications with Upgradability in Mind with Neil Bu...
 
Consistency and Completeness: Rethinking Distributed Stream Processing in Apa...
Consistency and Completeness: Rethinking Distributed Stream Processing in Apa...Consistency and Completeness: Rethinking Distributed Stream Processing in Apa...
Consistency and Completeness: Rethinking Distributed Stream Processing in Apa...
 
Introduction To RabbitMQ
Introduction To RabbitMQIntroduction To RabbitMQ
Introduction To RabbitMQ
 

Semelhante a Beyond REST and RPC: Asynchronous Eventing and Messaging Patterns

Azure architecture design patterns - proven solutions to common challenges
Azure architecture design patterns - proven solutions to common challengesAzure architecture design patterns - proven solutions to common challenges
Azure architecture design patterns - proven solutions to common challengesIvo Andreev
 
Microservice message routing on Kubernetes
Microservice message routing on KubernetesMicroservice message routing on Kubernetes
Microservice message routing on KubernetesFrans van Buul
 
apidays LIVE Jakarta - Building an Event-Driven Architecture by Harin Honesty...
apidays LIVE Jakarta - Building an Event-Driven Architecture by Harin Honesty...apidays LIVE Jakarta - Building an Event-Driven Architecture by Harin Honesty...
apidays LIVE Jakarta - Building an Event-Driven Architecture by Harin Honesty...apidays
 
AxonHub beta release 11 april 2018
AxonHub beta release 11 april 2018AxonHub beta release 11 april 2018
AxonHub beta release 11 april 2018Frans van Buul
 
Using AWS to Build a Scalable Big Data Management & Processing Service (BDT40...
Using AWS to Build a Scalable Big Data Management & Processing Service (BDT40...Using AWS to Build a Scalable Big Data Management & Processing Service (BDT40...
Using AWS to Build a Scalable Big Data Management & Processing Service (BDT40...Amazon Web Services
 
Adding Real-time Features to PHP Applications
Adding Real-time Features to PHP ApplicationsAdding Real-time Features to PHP Applications
Adding Real-time Features to PHP ApplicationsRonny López
 
AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...
AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...
AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...Amazon Web Services
 
Devfest uk & ireland using apache nifi with apache pulsar for fast data on-r...
Devfest uk & ireland  using apache nifi with apache pulsar for fast data on-r...Devfest uk & ireland  using apache nifi with apache pulsar for fast data on-r...
Devfest uk & ireland using apache nifi with apache pulsar for fast data on-r...Timothy Spann
 
AWS Study Group - Chapter 07 - Integrating Application Services [Solution Arc...
AWS Study Group - Chapter 07 - Integrating Application Services [Solution Arc...AWS Study Group - Chapter 07 - Integrating Application Services [Solution Arc...
AWS Study Group - Chapter 07 - Integrating Application Services [Solution Arc...QCloudMentor
 
QConSF-MicroServices-IPC-Netflix-Sudhir-2014.pptx
QConSF-MicroServices-IPC-Netflix-Sudhir-2014.pptxQConSF-MicroServices-IPC-Netflix-Sudhir-2014.pptx
QConSF-MicroServices-IPC-Netflix-Sudhir-2014.pptxVimalKumar143058
 
Cloud computing Module 2 First Part
Cloud computing Module 2 First PartCloud computing Module 2 First Part
Cloud computing Module 2 First PartSoumee Maschatak
 
Amazon EKS 그리고 Service Mesh (김세호 솔루션즈 아키텍트, AWS) :: Gaming on AWS 2018
Amazon EKS 그리고 Service Mesh (김세호 솔루션즈 아키텍트, AWS) :: Gaming on AWS 2018Amazon EKS 그리고 Service Mesh (김세호 솔루션즈 아키텍트, AWS) :: Gaming on AWS 2018
Amazon EKS 그리고 Service Mesh (김세호 솔루션즈 아키텍트, AWS) :: Gaming on AWS 2018Amazon Web Services Korea
 
Breaking the Monolith Road to Containers
Breaking the Monolith Road to ContainersBreaking the Monolith Road to Containers
Breaking the Monolith Road to ContainersAmazon Web Services
 
Introduction to Microservices
Introduction to MicroservicesIntroduction to Microservices
Introduction to MicroservicesMahmoudZidan41
 
Microservices architecture
Microservices architectureMicroservices architecture
Microservices architectureFaren faren
 

Semelhante a Beyond REST and RPC: Asynchronous Eventing and Messaging Patterns (20)

Azure architecture design patterns - proven solutions to common challenges
Azure architecture design patterns - proven solutions to common challengesAzure architecture design patterns - proven solutions to common challenges
Azure architecture design patterns - proven solutions to common challenges
 
RFID.pptx
RFID.pptxRFID.pptx
RFID.pptx
 
Microservice message routing on Kubernetes
Microservice message routing on KubernetesMicroservice message routing on Kubernetes
Microservice message routing on Kubernetes
 
apidays LIVE Jakarta - Building an Event-Driven Architecture by Harin Honesty...
apidays LIVE Jakarta - Building an Event-Driven Architecture by Harin Honesty...apidays LIVE Jakarta - Building an Event-Driven Architecture by Harin Honesty...
apidays LIVE Jakarta - Building an Event-Driven Architecture by Harin Honesty...
 
AxonHub beta release 11 april 2018
AxonHub beta release 11 april 2018AxonHub beta release 11 april 2018
AxonHub beta release 11 april 2018
 
Using AWS to Build a Scalable Big Data Management & Processing Service (BDT40...
Using AWS to Build a Scalable Big Data Management & Processing Service (BDT40...Using AWS to Build a Scalable Big Data Management & Processing Service (BDT40...
Using AWS to Build a Scalable Big Data Management & Processing Service (BDT40...
 
Microservices-101
Microservices-101Microservices-101
Microservices-101
 
Adding Real-time Features to PHP Applications
Adding Real-time Features to PHP ApplicationsAdding Real-time Features to PHP Applications
Adding Real-time Features to PHP Applications
 
AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...
AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...
AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...
 
Cloud presentation NELA
Cloud presentation NELACloud presentation NELA
Cloud presentation NELA
 
Devfest uk & ireland using apache nifi with apache pulsar for fast data on-r...
Devfest uk & ireland  using apache nifi with apache pulsar for fast data on-r...Devfest uk & ireland  using apache nifi with apache pulsar for fast data on-r...
Devfest uk & ireland using apache nifi with apache pulsar for fast data on-r...
 
AWS Study Group - Chapter 07 - Integrating Application Services [Solution Arc...
AWS Study Group - Chapter 07 - Integrating Application Services [Solution Arc...AWS Study Group - Chapter 07 - Integrating Application Services [Solution Arc...
AWS Study Group - Chapter 07 - Integrating Application Services [Solution Arc...
 
QConSF-MicroServices-IPC-Netflix-Sudhir-2014.pptx
QConSF-MicroServices-IPC-Netflix-Sudhir-2014.pptxQConSF-MicroServices-IPC-Netflix-Sudhir-2014.pptx
QConSF-MicroServices-IPC-Netflix-Sudhir-2014.pptx
 
Algorithmic Trading
Algorithmic TradingAlgorithmic Trading
Algorithmic Trading
 
Cloud computing Module 2 First Part
Cloud computing Module 2 First PartCloud computing Module 2 First Part
Cloud computing Module 2 First Part
 
Amazon EKS 그리고 Service Mesh (김세호 솔루션즈 아키텍트, AWS) :: Gaming on AWS 2018
Amazon EKS 그리고 Service Mesh (김세호 솔루션즈 아키텍트, AWS) :: Gaming on AWS 2018Amazon EKS 그리고 Service Mesh (김세호 솔루션즈 아키텍트, AWS) :: Gaming on AWS 2018
Amazon EKS 그리고 Service Mesh (김세호 솔루션즈 아키텍트, AWS) :: Gaming on AWS 2018
 
Breaking the Monolith Road to Containers
Breaking the Monolith Road to ContainersBreaking the Monolith Road to Containers
Breaking the Monolith Road to Containers
 
Introduction to Microservices
Introduction to MicroservicesIntroduction to Microservices
Introduction to Microservices
 
Microservices architecture
Microservices architectureMicroservices architecture
Microservices architecture
 
Intro to Azure Service Bus
Intro to Azure Service BusIntro to Azure Service Bus
Intro to Azure Service Bus
 

Último

Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationkaushalgiri8080
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendArshad QA
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number SystemsJheuzeDellosa
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfCionsystems
 

Último (20)

Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanation
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
Exploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the ProcessExploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the Process
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and Backend
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number Systems
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdf
 

Beyond REST and RPC: Asynchronous Eventing and Messaging Patterns

  • 1. Beyond REST and RPC: Asynchronous Eventing and Messaging Patterns Clemens Vasters Principal Architect – Azure Messaging, Microsoft @clemensv OASIS AMQP Technical Committee Chair OASIS MQTT TC Member CNCF CloudEvents Architect OPC UA PubSub Architect
  • 2. Agenda • Asynchronous Communication Patterns • Principles and Standards • Projects, Products, and Services
  • 3. Demo ;) m = new Message( Encoding.UTF8.GetBytes("Hello!")); await sender.SendAsync( ); receiver.RegisterMessageHandler( ( ) => { Console.WriteLine( Encoding.UTF8.GetString(m.Body)); }); do { m = receiver.Receive( ); if ( m != null ) { Console.WriteLine( Encoding.UTF8.GetString(m.Body)); } } while ( m != null ); m m m mmm
  • 5. Synchronous vs. Asynchronous • Sender sends request and then waits for an immediate answer • May happen via asynchronous I/O, but the logical thread is preserved. • Correlation between request and reply is typically implicit, by order of requests. • Errors typically flow back on the same path. • Sender sends a message and proceeds to do other things. • Replies may flow back on a separate path. • Messages may be stored by intermediaries. • Message delivery may be attempted multiple times. • … ReceiverSender ReceiverSender Interaction duration: Microseconds to seconds Interaction duration: Microseconds to years
  • 6. One-Way!?! • Asynchronous flows are generally one-way. • The producer gets no initial answer other than the message having been accepted into the queue/buffer. • Remain seated. Stay calm! • Reply and error channels are explicit. • Correlation is flexible. Multiple replies may refer to one message. ConsumerProducer in reply to Pull One-way reply channel(s) One-way error channel Push
  • 7. Long-RunningWork • Processing at the consumer may take very long (minutes to hours) • Processing at the consumer may require reliable, one-time outcomes (like execution of payments). • Producers entrust jobs into a queue. • Consumers negotiate the outcome, including any required retries due to intermittent failures with the queue • Bad jobs are moved into a dead- letter queue for inspection. • Flow back to the producer is performed through a reply queue ConsumerProducer correlationid: reply queue replyto: dead-letter queue Retry 1 Retry 2
  • 8. Load Leveling • Queues/buffers act as an inbox for requests to a consumer. • Push/pull translation: Consumer pulls work when it has capacity for processing. • Consumer processes at its own pace, without ever getting overloaded. • No “too busy” errors, easier resource governance. Consumer Producer Producer Producer Producer Producer requests/sec time requests/sec time processing capacity
  • 9. Load Balancing and Auto Scaling • Multiple consumers compete for messages • Each consumer only pulls work when it has capacity for processing. • Truly load-aware job balancing • Queue-length can be observed; if rolling average crosses a threshold, more consumers can be added to auto-scale based on true load. Consumer Producer Producer Producer Producer Producer queue length rolling average time scale-up threshold scale-down threshold +1 Consumer Consumer
  • 10. Publish-Subscribe • Directing one input message to zero or more interested parties (subscribers). • Every subscriber has the opportunity to obtain a copy of every published message. • Subscribers can often provide filters that select a subset of the published messages. ConsumerProducer 2 4 6 1 2 3 1 3 5 Topic filter filter filter Consumer Consumer
  • 11. Partitioning • Partitioning is not the same as publish-subscribe • Partitions are chosen while publishing, not while subscribing • Partitioning serves to subdivide a stream such that • it can be stored reliably if the volume is enormous • it can be processed with multiple consumers in parallel and without overlaps • Pub-Sub can compose with partitioning by letting subscribers choose partition subsets. ConsumerProducer b b b a a a c c c Stream Consumer Consumer hash() Partition 1 Partition 2 Partition 3
  • 12. Multiplexing with Exclusive Consumers • Multiplexing funnels sequences of related messages concurrently through one route. • Exclusive consumers snap to sequences and the queue guarantees consistent routing of messages to the same consumer. • Provides first-in-first-out assurance on a per-sequence basis. • Can be provided without head-of- line blocking, i.e. each sequence acts like an independent sub-queue. • Often used with scenarios where huge numbers of contexts must be handled, e.g. in workflow processing. Consumer Producer Producer Producer Consumer Consumer
  • 13. Consumer Partition 1 Consumer Partition 3 Stateful Processing • Stateful processing is simplified by pulling a stream stepwise towards a state aggregator (like calculating a rolling average). • Consumption can be easily suspended, the state moved, and consumption resumed elsewhere when needed. Consumer State A+B+C A B CProducer
  • 14. Sparse Connectivity • Sparse connectivity is common with wireless applications, including IoT edge applications. • Mobile users switch networks, go out of range, hit bandwidth caps, etc. • Mobile applications get frequently suspended. • You can make communication paths more robust by making them strictly async and using a local store/forward queue setup. Consumer Producer Push Pull store and forward queue Unreliable network boundary, e.g. mobile wireless networking move messages while online
  • 15. Edge Cloud App App App Pub-Sub State Synchronization App App ∑ Telemetry Capture for Analytics ∑ App Fn Business Workflow Coordination FnApp DHCP, NAT, Firewalls Composite Edge and Cloud Patterns e.g. “Digital Twin“ Cloud Analytics Broker Broker Broker App
  • 17. Azure Messaging Protocol Principles • Protocols we prefer must be vendor-neutral, have a formal definition independent of any implementation, and must be under neutral governance. • We prefer formal standardization venues such that standards can be composed and be the basis of formal certification programs:W3C, OASIS, IETF, ISO, IEC • Multiple, competing implementations of the full protocol feature range must exist, not just clients. • Protocols must be secure, integrate with federated authorization models, and be compatible with common enterprise network policy practices. • Protocols must fit the target scenario and not require product-specific extensions for the scenario to work. Still, they must be extensible to allow for backwards- compatible evolution in the context of standards collaboration.
  • 18. Azure Messaging Protocol Pillars • IETF HTTPS & WebSocket Protocol • Request-response application protocol • Azure Services: Azure Event Hubs,Azure Service Bus,Azure EventGrid, Azure Relay, Azure IoT Hub • OASIS AMQP 1.0 • Vendor-independent and product-independent, symmetric, reliable message transfer protocol with support for multiplexing and flow control • Azure Services: Azure Event Hubs,Azure Service Bus,Azure IoT Hub • OSS: ApacheActiveMQ Classic, ApacheActiveMQ Artemis, Apache Qpid Broker-J, Apache QpidC++,Apache Qpid Dispatch Router, Apache Camel, CNCF Strimzi Bridge, Eclipse Hono, Eclipse Ditto, Pivotal RabbitMQ • OASIS MQTT 3.x/5.x • Vendor-independent and product-independent, reliable publish-subscribe protocol for telemetry transfer and state synchronization • Azure Services: Azure IoT Hub • OSS: Apache ActiveMQ Classic, Apache ActiveMQ Artemis, Eclipse Hono, Pivotal RabbitMQ, Eclipse Mosquitto, HiveMQ,VerneMQ, etc. • CNCF CloudEvents • Vendor-independent and product-independent event data model with multiple bindings to protocols and encodings • Azure Services: Azure EventGrid, Azure Service Bus and Event Hubs via AMQP • We support other protocols as needed, in order to meet customers where they are.
  • 19. Some Interop Options with AMQP and MQTT Dispatch Router Eclipse Hono IoT Connectivity Platform Azure IoT Hub Apache ActiveMQ Eclipse Mosquitto RabbitMQ w/ AMQP 1.0 plugin Azure Service Bus Azure Event Hubs Eclipse Ditto Twins Apache Camel CNCF Strimzi MQTT MQTT MQTT MQTT/AMQP MQTT/AMQP AMQP AMQP AMQP AMQP AMQP App App App App App App App App App AMQP AMQP AMQP AMQP
  • 20. Edge Azure Cloud App App App Pub-Sub State Synchronization (MQTT, AMQP) App App ∑ Telemetry Capture for Analytics (Kafka, AMQP) ∑ App Fn Business Workflow Coordination (AMQP, HTTP) Fn App DHCP, NAT, Firewalls Service Bus Service BusEvent Hubs Service Bus Apache ActiveMQ CNCF Strimzi RabbitMQ w/ AMQP 1.0 plugin Edge/cloud federation examples Dispatch Router Dispatch Router
  • 22. Cross-Site/Cross-Region Federation with Apache Qpid Dispatch Dispatch Router Apache ActiveMQ RabbitMQ w/ AMQP 1.0 plugin Azure Service Bus Apache ActiveMQ RabbitMQ w/ AMQP 1.0 plugin Azure Service Bus Azure Event Hubs CNCF Strimzi
  • 24. Azure Messaging Suite Azure Service Bus Azure Event Hubs Azure Event Grid Azure Relay
  • 25. Why four services?Very different patterns. Event Grid Push-style distribution of discrete events to serverless workloads Service Bus Pull-style, queue-based transfer of jobs and control via message queues and topics Event Hubs Partitioned, high-volume, tape-drive- style sequential recording and unlimited, pull-style re-reads of event streams. Relay Discovery and connectivity service for securely bridging streams across network boundaries in hybrid edge/cloud scenarios. Message Oriented Services Connectivity Services HTTP AMQP/WS HTTP AMQP/WS KRPC HTTP (AMQP/WS) WS
  • 26. Event Hubs Architectural Patterns Event Hubs is a high-scale, high-availability, multi-protocol event stream engine used for collecting and consolidating events for real-time analytics and other high-throughput computations Event Hub ◦ Ingestion and storage of large event streams ◦ > 2 Gigabyte per second if required ◦ Separation of event streams into partitions ◦ Client-chosen offsets into event stream allow arbitrary reads and re-reads during retention ◦ Retention of raw event data from 1 up to 90 days ◦ Automated archival into Avro containers for subsequent batch- style processing ◦ Publisher policies for data origin attestation and access control ◦ Supports the Apache Kafka™ producer and consumer wire protocol to meet customers where they are HTTP AMQP/WS KRPC (Kafka)
  • 27. Service Bus Architectural Patterns Service Bus is a “swiss army knife” for messaging-driven workloads. Queues Topics ◦ Assignment of work with load-aware balancing ◦ Load-leveling for “spiky” workload traffic shapes ◦ Transactional, once-and-only-once processing ◦ Multiplex handling of in-order message sequences ◦ Deduplication, deferral, and “poison” handling ◦ All of the above, plus: ◦ Copies to 100s of concurrent subscribers ◦ Filter rules and message markup ◦ Message routing HTTP AMQP/WS HTTP AMQP/WS
  • 28. Event Grid Architectural Patterns Event Grid is the Azure-wide eventing backplane for distributing and handling discrete events raised at the platform level, by custom applications, and by partner platforms. Event Grid ◦ Ingestion and push-style distribution of discrete events (events not correlated into streams) to interested subscribers. ◦ Per-subscriber application of simple and complex filters to select particular events of interest ◦ Abuse protection for event publishers ◦ Event schema mapping and support for CNCFCloudEvents 1.0 standard and bindings ◦ Multitenancy support for SaaS applications. ◦ Simple integration with a catalog of available event sources and sinks. HTTP AMQP/WS
  • 29. Buffered Communication and Queues • Producers push messages in, consumers pull messages out. • Producers and consumers maintain independent security relationships with the intermediary. • Producers and consumers are temporally decoupled. • Order of arrival typically determines order of delivery • Queues manage which messages to deliver next. Buffers leave that to the client. • Most network communication is queue- based, at multiple levels: • Dispatch queues • Thread pool queues • Packet transfer queues ConsumerProducer Push Pull One-way flow!
  • 30. RelayArchitectural patterns • Expose (micro-) services, databases, and other endpoints from private networks on a public network endpoint without requiringVPN connectivity and/or DNS integration. • Ad-hoc discovery of endpoints with dynamic network addresses • Firewall and NAT traversal for one or both communicating parties • Endpoint-level bridging across Azure VNet • “Azure Bridge” runtime allows for bridging UDP,TCP, and Unix sockets Relay WS
  • 31. Thanks for joining ! @clemensv https://docs.microsoft.com/azure/messaging-services/
  • 32. © 2020 Microsoft Corporation. All rights reserved. The text in this document is available under the Creative Commons Attribution 3.0 License, additional terms may apply. All other content contained in this document (including, without limitation, trademarks, logos, images, etc.) are not included within the Creative Commons license grant. This document does not provide you with any legal rights to any intellectual property in any Microsoft product. You may copy and use this document for your internal, reference purposes. This document is provided "as-is." Information and views expressed in this document, including URL and other Internet Web site references, may change without notice. You bear the risk of using it. Some examples are for illustration only and are fictitious. No real association is intended or inferred. Microsoft makes no warranties, express or implied, with respect to the information provided here.