Asynchronous messaging
Asynchronous messaging Benefits, Patterns, Technologies
Exercise: Box Breathing
Box Breathing
Point-to-Point
Communication
When Servers Crash
DB
App
[HTTP] $$ Order
Tx
Call 1 of 3
Call 2 of 3
RollbackServer update
TxApp
DB
Call 1 of 3
Deadlock
Exception
Write to log A B
Call 2 of 3
Where’s the order!?
When Deadlocks Happen
Securing client requests with Messaging
TxQ$$ Order
App
Receive
DBCall 1 of 3
Rollback
Call 2 of 3
Rollback
The order is back in the queue
© 2016 Deloitte The Netherlands 12Insert your footer here
Provider Consumer
Queue
Consumer
Consumer
Send
command
Publish event
Provider
Consumer
Queue 1
Consumer
Consumer
Message Bus
Consumer
Queue 2
Consumer
Consumer
Consumer
Queue N
Consumer
Consumer
Pub/sub
RPC / REST
Event driven
Travel Agent
Booking
Invoicing
Tour guide
Make reservation, pay
Mike registered for tour X, on date Y (event)
Date Traveller
1-1-2017 Mike
Projection
Read model
Messaging patterns
At least once
delivery
Fore and Forget
Saga
BASE
Cross-cutting concerns
Inside services: Pipes and filters
© 2016 Deloitte The Netherlands
27
MSMQ
Messaging
middleware
© 2016 Deloitte The Netherlands 28Insert your footer here
© 2016 Deloitte The Netherlands
MassTransit NServiceBus
RabbitMQ RabbitMQ
Azure Service Bus Azure Service Bus
MSMQ MSMQ
ActiveMQ
29Insert your footer here
Feb 2016:
Introduction of asynchronous messaging
DDTP
Message persistence
Message routing
Pub/sub
Load balancing
Operations Queues
Topics
Exchanges
Messages
Create exchanges
Create queues
Message routing C#
C# Handling Pipeline
Saga state
persistence
Test support
Conn. management
Message Types
Consumers
Observers
Sagas
Endpoints
Resources:
MassTransit / RabbitMQ
examples
eventstore-masstransit-poc
http://nldlc0068.dlc.local/projects/TOOLS/repos/
eventstore-masstransit-poc
MassTransit Publish/Subscribe example
http://looselycoupledlabs.com/2014/06/masstran
sit-publish-subscribe-example
Event Driven Architecture
Training
All video’s of Udi Dahans’ workshop on request
Deloitte refers to one or more of Deloitte Touche Tohmatsu Limited, a UK private company limited by guarantee (“DTTL”), its network of member firms, and their related
entities. DTTL and each of its member firms are legally separate and independent entities. DTTL (also referred to as “Deloitte Global”) does not provide services to clients.
Please see www.deloitte.nl/about for a more detailed description of DTTL and its member firms.
Deloitte provides audit, consulting, financial advisory, risk management, tax and related services to public and private clients spanning multiple industries. Deloitte serves four
out of five Fortune Global 500® companies through a globally connected network of member firms in more than 150 countries bringing world-class capabilities, insights, and
high-quality service to address clients’ most complex business challenges. To learn more about how Deloitte’s approximately 225,000 professionals make an impact that
matters, please connect with us on Facebook, LinkedIn, or Twitter.
This communication contains general information only, and none of Deloitte Touche Tohmatsu Limited, its member firms, or their related entities (collectively, the “Deloitte
Network”) is, by means of this communication, rendering professional advice or services. Before making any decision or taking any action that may affect your finances or your
business, you should consult a qualified professional adviser. No entity in the Deloitte Network shall be responsible for any loss whatsoever sustained by any person who relies
on this communication.
© 2016 Deloitte The Netherlands

Asynchronous messaging benefits, patterns, technologies

Editor's Notes

  • #4 It's been known for thousands of years in yoga as "samavritti pranayama", or "square breath". Has its origin in Hinduism. The advice is to count on the finger of one hand. Inhale while stepping 1 2 3 4, Hold 1 2 3 4, Exhale 1 2 3 4 and Hold 1 2 3 4. All of this without mentally counting, just use your fingers to do the steps. It is recommended before meditation for calming the agitated mind.
  • #5 SOA: No more integration over database But often applied as technical separation: separation between UI, Orchestration, Business logic, Data access
  • #6 Microservices: Emphasis on separating applications based on functional requirements
  • #8 point to point synchronous communication: Coupling in time, single listener. Message is lost if nobody is listening at the other end.
  • #9 Slow form of async communication,. Fire and forget.
  • #10 Async communication, can feel like instant communication with modern technologies
  • #14 Zie 06 - Messaging Patterns - Part 1 - particular-1.flv. Meer requests > meer server threads. Thread gebruikt geheugen (stack, niet heap). Iedere thread gebruikt 1MB stack geheugen + heap geheugen dat de thread gebruikt. Bij meer gelijktijdige threads meer geheugengebruik, zolang er voldoende geheugen op de server is is dat geen probleem. Bij onvoeldoende server resources/threads: melding connection refused.
  • #15 High load
  • #16 queues
  • #18 Smart endpoints, dumb pipes
  • #19 How to implement this? When the page opens, query the ERP for stock details, query the CRM for sales activity, query the webshop for sales data? A chain is only as strong as its weakest link
  • #20 Book a ticket at a travel agency
  • #21 Bus driver needs to check whether you booked and payed
  • #22 Query provider
  • #23 YES, event driven == redundant data but this is fine as long as there is only one owner
  • #26 Logging Authentication Authorisation Exception handling Pipe and filters
  • #29 Amazon Simple Queue Service (SQS) ZeroMQ: Peter Hintjens, performance, no mature solution for persistence of messages Kafka: log/journal/queue Azure service bus max message size: 256KB Not available on premise MSMQ max message size: 4MB RabbitMQ better communication and less issues than ActiveMQ
  • #30 http://lh4.ggpht.com/_159eVJubwBA/TaIfaYZkbLI/AAAAAAAABTQ/_7HNkLE5rhQ/mqshootout%5B5%5D.jpg?imgmax=800
  • #32 RabbitMQ: pub/sub, broker, infrastructure, persistence
  • #35 Create exchanges and queues based on topics (types) and consumers