yellow.4 marjan nikolovski hunting rabbits and event-driven programming
DESCRIPTION
Solving problems with event-driven architecture, pub-sub concepts, cross-boundaries event-driven communication and building event-driven applications with RabbitMQ in .NET Covered technologies: .NET 4.0, RabbitMQTRANSCRIPT
![Page 1: Yellow.4 marjan nikolovski hunting rabbits and event-driven programming](https://reader034.vdocument.in/reader034/viewer/2022052505/554f9859b4c9057b298b45d6/html5/thumbnails/1.jpg)
![Page 2: Yellow.4 marjan nikolovski hunting rabbits and event-driven programming](https://reader034.vdocument.in/reader034/viewer/2022052505/554f9859b4c9057b298b45d6/html5/thumbnails/2.jpg)
Hunting rabbits and event-driven programming
Marjan Nikolovski
![Page 3: Yellow.4 marjan nikolovski hunting rabbits and event-driven programming](https://reader034.vdocument.in/reader034/viewer/2022052505/554f9859b4c9057b298b45d6/html5/thumbnails/3.jpg)
![Page 4: Yellow.4 marjan nikolovski hunting rabbits and event-driven programming](https://reader034.vdocument.in/reader034/viewer/2022052505/554f9859b4c9057b298b45d6/html5/thumbnails/4.jpg)
![Page 5: Yellow.4 marjan nikolovski hunting rabbits and event-driven programming](https://reader034.vdocument.in/reader034/viewer/2022052505/554f9859b4c9057b298b45d6/html5/thumbnails/5.jpg)
{Agenda‹ Basics and introduction to EDA‹ Messaging patterns‹ Internal and cross boundaries messaging‹ Products and technologies‹ Demo
![Page 6: Yellow.4 marjan nikolovski hunting rabbits and event-driven programming](https://reader034.vdocument.in/reader034/viewer/2022052505/554f9859b4c9057b298b45d6/html5/thumbnails/6.jpg)
Basics and introduction to EDA‹ So what is an event ?
‹ Event-driven behavior as part of our life‹ What is EDA ?
‹ Event-driven behavior as part of out apps‹ Current apps situation‹ To event-driven behavior situation
‹ How can we establish event-driven architecture ?‹ Layering introduced in event-driven apps
‹ Why we want to build event-driven apps?
{
![Page 7: Yellow.4 marjan nikolovski hunting rabbits and event-driven programming](https://reader034.vdocument.in/reader034/viewer/2022052505/554f9859b4c9057b298b45d6/html5/thumbnails/7.jpg)
So what is an event ?{‹ An event is an occurrence within a particular system or domain; it is
something that has happened, or is contemplated as having happened in that domain.
‹ Characteristics‹ Unique ‹ Time relevant
![Page 8: Yellow.4 marjan nikolovski hunting rabbits and event-driven programming](https://reader034.vdocument.in/reader034/viewer/2022052505/554f9859b4c9057b298b45d6/html5/thumbnails/8.jpg)
Event-driven behavior as part of our life{
On new salary
received
Go shopping
On account empty
Wait for next
salary
![Page 9: Yellow.4 marjan nikolovski hunting rabbits and event-driven programming](https://reader034.vdocument.in/reader034/viewer/2022052505/554f9859b4c9057b298b45d6/html5/thumbnails/9.jpg)
What is EDA ?{‹ WIKI says: Event-driven architecture (EDA) is a software architecture
pattern promoting the production, detection, consumption of, and reaction to events.
Event producer
Event processor
Event consumer
![Page 10: Yellow.4 marjan nikolovski hunting rabbits and event-driven programming](https://reader034.vdocument.in/reader034/viewer/2022052505/554f9859b4c9057b298b45d6/html5/thumbnails/10.jpg)
Event-driven behavior as part of out apps{
Event-driven apps
Observation
Predictive processing
Information dissemination
Dynamic operational behavior
Active diagnostics
![Page 11: Yellow.4 marjan nikolovski hunting rabbits and event-driven programming](https://reader034.vdocument.in/reader034/viewer/2022052505/554f9859b4c9057b298b45d6/html5/thumbnails/11.jpg)
Current apps situationRequest – response scenario{
![Page 12: Yellow.4 marjan nikolovski hunting rabbits and event-driven programming](https://reader034.vdocument.in/reader034/viewer/2022052505/554f9859b4c9057b298b45d6/html5/thumbnails/12.jpg)
Current apps situationRequest – response scenario{
![Page 13: Yellow.4 marjan nikolovski hunting rabbits and event-driven programming](https://reader034.vdocument.in/reader034/viewer/2022052505/554f9859b4c9057b298b45d6/html5/thumbnails/13.jpg)
Current apps situationPull (time based)scenario{
![Page 14: Yellow.4 marjan nikolovski hunting rabbits and event-driven programming](https://reader034.vdocument.in/reader034/viewer/2022052505/554f9859b4c9057b298b45d6/html5/thumbnails/14.jpg)
To event-driven behavior situationEvent scenario{
Don’t call us, we will call you
![Page 15: Yellow.4 marjan nikolovski hunting rabbits and event-driven programming](https://reader034.vdocument.in/reader034/viewer/2022052505/554f9859b4c9057b298b45d6/html5/thumbnails/15.jpg)
To event-driven behavior situationEvent scenario{
![Page 16: Yellow.4 marjan nikolovski hunting rabbits and event-driven programming](https://reader034.vdocument.in/reader034/viewer/2022052505/554f9859b4c9057b298b45d6/html5/thumbnails/16.jpg)
To event-driven behavior situationEvent scenario{
![Page 17: Yellow.4 marjan nikolovski hunting rabbits and event-driven programming](https://reader034.vdocument.in/reader034/viewer/2022052505/554f9859b4c9057b298b45d6/html5/thumbnails/17.jpg)
To event-driven behavior situationEvent scenario{
![Page 18: Yellow.4 marjan nikolovski hunting rabbits and event-driven programming](https://reader034.vdocument.in/reader034/viewer/2022052505/554f9859b4c9057b298b45d6/html5/thumbnails/18.jpg)
How can we establish event-driven architecture ?{‹ Good analyses
‹ Stick to Open/Closed and Single responsibility principles‹ Define the domain
‹ Define:‹ Who are event producers‹ Who are event consumers
‹ Introduce event dispatcher (the mediator)‹ Determine event channel‹ Everyone do what they are supposed to do, everything else they
delegate to other involved parties via the event dispatcher
![Page 19: Yellow.4 marjan nikolovski hunting rabbits and event-driven programming](https://reader034.vdocument.in/reader034/viewer/2022052505/554f9859b4c9057b298b45d6/html5/thumbnails/19.jpg)
Layering introduced in event-driven apps{‹ Event publisher
‹ Any client that generates events‹ Event mediation and Event channels
‹ Event distribution‹ Events transport via memory, raw, xml, rest, protobuff …
‹ Event subscriber‹ Any client that consumes the events
‹ Choose event processing strategy‹ Simple processing (forwarding)‹ Event streaming (creating events from streamed data and send it to subscribers)‹ Complex event processing (pattern detection on events)
![Page 20: Yellow.4 marjan nikolovski hunting rabbits and event-driven programming](https://reader034.vdocument.in/reader034/viewer/2022052505/554f9859b4c9057b298b45d6/html5/thumbnails/20.jpg)
Layering introduced in event-driven apps{
Prod
ucer
s
Med
iatio
n an
d ch
anne
ls
Cons
umer
s
![Page 21: Yellow.4 marjan nikolovski hunting rabbits and event-driven programming](https://reader034.vdocument.in/reader034/viewer/2022052505/554f9859b4c9057b298b45d6/html5/thumbnails/21.jpg)
Why we want to build event-driven apps?{‹ Pros
‹ Exploit parallelism‹ Better system design - each event has its own processor (single responsibility)‹ Reduce dependencies in the system‹ Reduce coupling‹ Easier testing‹ Real time monitoring‹ Scalability‹ Maintainability
‹ Cons‹ Highly abstract concept
![Page 22: Yellow.4 marjan nikolovski hunting rabbits and event-driven programming](https://reader034.vdocument.in/reader034/viewer/2022052505/554f9859b4c9057b298b45d6/html5/thumbnails/22.jpg)
Messaging patterns{‹ Publish-subscribe aka PubSub‹ Topic based PubSub‹ Point-to-point‹ Request-reply‹ Store and forward‹ Pipeline
![Page 23: Yellow.4 marjan nikolovski hunting rabbits and event-driven programming](https://reader034.vdocument.in/reader034/viewer/2022052505/554f9859b4c9057b298b45d6/html5/thumbnails/23.jpg)
Publish-subscribe aka PubSub{Publisher
Topic
Subscriber Subscriber
Consumes the event Consumes the event
Publish an event
![Page 24: Yellow.4 marjan nikolovski hunting rabbits and event-driven programming](https://reader034.vdocument.in/reader034/viewer/2022052505/554f9859b4c9057b298b45d6/html5/thumbnails/24.jpg)
Topic based PubSub{
Publisher
Topic
Subscriber Subscriber
Consumes the event Consumes the event
Publish an event
SubtopicSubscriber
Consumes the event
![Page 25: Yellow.4 marjan nikolovski hunting rabbits and event-driven programming](https://reader034.vdocument.in/reader034/viewer/2022052505/554f9859b4c9057b298b45d6/html5/thumbnails/25.jpg)
Point-to-point{
Publisher SubscriberQueue
![Page 26: Yellow.4 marjan nikolovski hunting rabbits and event-driven programming](https://reader034.vdocument.in/reader034/viewer/2022052505/554f9859b4c9057b298b45d6/html5/thumbnails/26.jpg)
Request-reply{
Publisher/Subscriber SubscriberTopic
Subscriber
Subscriber
![Page 27: Yellow.4 marjan nikolovski hunting rabbits and event-driven programming](https://reader034.vdocument.in/reader034/viewer/2022052505/554f9859b4c9057b298b45d6/html5/thumbnails/27.jpg)
Store and forward{
Publisher/Subscriber SubscriberTopic
Subscriber
Subscriber
Data
![Page 28: Yellow.4 marjan nikolovski hunting rabbits and event-driven programming](https://reader034.vdocument.in/reader034/viewer/2022052505/554f9859b4c9057b298b45d6/html5/thumbnails/28.jpg)
Pipeline{
Publisher SubscriberTopic Subscriber Subscriber
![Page 29: Yellow.4 marjan nikolovski hunting rabbits and event-driven programming](https://reader034.vdocument.in/reader034/viewer/2022052505/554f9859b4c9057b298b45d6/html5/thumbnails/29.jpg)
Internal and cross boundaries messaging{‹ Internal messaging via in memory event dispatcher
‹ Decorate the subscribers in the system‹ Decorate the receivers in the system‹ Develop custom event dispatcher that will dispatch the producer events to the
consumer‹ Cross boundaries messaging via
‹ Any full-duplex communication‹ Web/Url callbacks‹ Web based push notifications - long pooling AJAX request‹ Queue‹ Custom messaging software
![Page 30: Yellow.4 marjan nikolovski hunting rabbits and event-driven programming](https://reader034.vdocument.in/reader034/viewer/2022052505/554f9859b4c9057b298b45d6/html5/thumbnails/30.jpg)
Products and technologies{‹ XMPP based products
‹ Ejabberd‹ AMQP based products
‹ RabbitMQ‹ OpenAMQP‹ Apache QPID
‹ STOMP based products‹ ActiveMQ
‹ JMS‹ Other
‹ MSMQ‹ Azure Service Bus‹ ZeroMQ
![Page 31: Yellow.4 marjan nikolovski hunting rabbits and event-driven programming](https://reader034.vdocument.in/reader034/viewer/2022052505/554f9859b4c9057b298b45d6/html5/thumbnails/31.jpg)
AMQP protocol{‹ Advanced message queuing protocol for message-oriented middleware
‹ Queuing‹ Routing (point to point, PubSub)‹ Reliable‹ Secure
‹ Interoperability on protocol level instead of API level‹ So how does it work behind the scenes:
‹ Exchanges‹ Queues‹ Bindings‹ Messages
![Page 32: Yellow.4 marjan nikolovski hunting rabbits and event-driven programming](https://reader034.vdocument.in/reader034/viewer/2022052505/554f9859b4c9057b298b45d6/html5/thumbnails/32.jpg)
{
Publisher
Publisher
Publisher
Consumer
Consumer
Exchange
Exchange
Queue
QueueBinding
Binding
RabbitMQ Broker
![Page 33: Yellow.4 marjan nikolovski hunting rabbits and event-driven programming](https://reader034.vdocument.in/reader034/viewer/2022052505/554f9859b4c9057b298b45d6/html5/thumbnails/33.jpg)
Message exchange{
Bindings
Exchange
Queues
Topic Fanout Direct
Q1 Q2 Q3 Q4 Q5 Q6
System.Logs.* System.Interupts.* SomeKey
![Page 34: Yellow.4 marjan nikolovski hunting rabbits and event-driven programming](https://reader034.vdocument.in/reader034/viewer/2022052505/554f9859b4c9057b298b45d6/html5/thumbnails/34.jpg)
{
![Page 35: Yellow.4 marjan nikolovski hunting rabbits and event-driven programming](https://reader034.vdocument.in/reader034/viewer/2022052505/554f9859b4c9057b298b45d6/html5/thumbnails/35.jpg)
Questions? Complete electronic evaluation forms
on the computers in the hall and enter to win!– Telerik Ultimate Collection– RedGate .NET Reflector VSPro– ComponentOne Enterprise Studio Suite– Pluralsight yearly subscriptions– CodeSmith Tools Generator Pro Personal– JetBrains ReSharper– Semos Education Training Voucher– and many more…
![Page 36: Yellow.4 marjan nikolovski hunting rabbits and event-driven programming](https://reader034.vdocument.in/reader034/viewer/2022052505/554f9859b4c9057b298b45d6/html5/thumbnails/36.jpg)