SlideShare a Scribd company logo
PASS THE MESSAGE with RabbitMQ
DONE THIS?
JobId Address Message Status
1 anders@ljusberg.se Hello Anders, Lorem
Ipsum
Sent
2 CodingInsomnia@outloo
k.com
Hello Anders, Lorem
Ipsum
Processing
3 andlju@gmail.com Hello Anders, Lorem
Ipsum
Waiting
EmailSender
SELECT TOP 1 * FROM EmailSender WHERE Status = ’Waiting’
UPDATE EmailSender SET Status = ’Processing’ WHERE JobId = 3
OR THIS?
ProductId Amount LastUpdate
1 4711.50 2015-05-
26T13:37:42.4711
2 1337.40 2015-05-
26T13:37:43.1234
3 42.50 2015-05-
26T13:38:05.4561
Prices
SELECT * FROM Prices
WHERE LastUpdate > ’2015-05-20T04:40:09.123’
ME, ME, ME
Solution Designer at Thomas Cook
Organizer of Swenug
Co-founder of Swetugg
Tweeter at @CodingInsomnia
TOPICS
Queues and Messages
RabbitMQ
Messaging Patterns
Samples
MESSAGE QUEUE
FIFO - First In - First Out
Producers creates a message
Consumers process messages
Asynchronous communication
MESSAGE QUEUE
Producer
Consume
r
RABBITMQ
Message Broker
Erlang runtime
Cross-Platform
MESSAGES IN RABBITMQ
Byte Arrays
Usually JSON or XML
Size limited by server memory
Headers
SETTING UP RABBITMQ
C:>choco install RabbitMQ
C:>rabbitmq-plugins enable rabbitmq_management
USING RABBITMQ FROM .NET
PS C:> Install-Package RabbitMQ.Client
CODE Hello World
MESSAGING PATTERNS
Work queues
Publish-Subscribe
Request-Reply
Message Routing
WORK QUEUES
One or more Producers
One or more Consumers
A single, shared queue
Consume
r
Producer
WORK QUEUES
Producer
Consume
r
CODE Work Queues
PUBLISH-SUBSCRIBE
One or more Publishers
Any number of Subscribers
Copy of the message to each Subscriber
EXCHANGES
Messages are always published to an Exchange
Queues bind to Exchanges
FANOUT EXCHANGE
Subscribe
r
Subscribe
r
Subscribe
r
Publisher Fanout
Exchang
e
CODE Publish-Subscribe
ROUTING
More control over what message ends up where
Direct Exchange
Topic Exchange
Headers Exchange
DIRECT EXCHANGE
Bind to a Direct Exchange with a RoutingKey
Messages published to the exchange are routed
to queues with a matching key
DIRECT EXCHANGE
Subscribe
r
Subscribe
r
Subscribe
r
Publisher Direct
Exchang
e
a aa
a
b
b
b
b
TOPIC EXCHANGE
Bind to a Topic Exchange with a RoutingKey
pattern
”order.book”, ”order.dvd”, ”order.dvd.payment”
List of words delimited by dots
Wildcards
A * matches any single word (”order.*”)
A # matches zero or more words (”order.#”)
TOPIC EXCHANGE
Subscribe
r
Subscribe
r
Subscribe
r
Publisher Topic
Exchang
e
a.1
*.1
a.1
a.1b.
1
b.
1
b.
1
MICROSERVICES
Tiny building blocks
Message-oriented
Need new functionality? Build a new service.
Need to refactor? Throw the old service away.
MICRO SERVICES
Message Bus (Topic Exchange)
Web
Email handler
Contact
handler
query:
anders
@ljusberg.s
e
contact:
1
response:
Anders
Ljusberg
respon
se
MICRO SERVICES
Message Bus (Topic Exchange)
Web
Email handler
Contact
handler
query:
@CodingIns
respon
se
Twitter
handler
response:
Anders
Ljusberg
contact:
1
CODE Microservices
MESSAGE TTL
How long is this message valid?
Per queue
Removed immidately
Per message
Removed when at front of queue
DEAD LETTER EXCHANGE
Failed messages can be routed to a Dead Letter
Exchange
Any type of Exchange
Rejected messages
Messages that have timed out
Queue length exceeded
DEAD LETTER EXCHANGE
Producer
Consume
r
Exchang
e
Error
handler
Dead Letter Exchange
CODE Dead Letters
THINGS I SKIPPED
Request-Reply
Headers Exchange
SUMMARY
Message Queuing is good
Microservices is.. well.. interesting..
THERE’S MUCH MORE…
Frameworks
MassTransit
EasyNetQ
High Availability
 Federation
 Clustering
 Load Balancing
Priority Queues
Message Scheduling
QUESTIONS?
@CodingInsomnia
anders@ljusberg.se
http://coding-
insomnia.com
https://github.com/a
ndlju
http://www.swenug.s
e
Other stuff:
http://rabbitmq.com
http://erlang.org
https://chocolatey.org
http://masstransit-project.com
http://easynetq.com

More Related Content

Viewers also liked

Certified quality professional
Certified quality professionalCertified quality professional
Certified quality professional
Vin Williams
 
Certified Quality Professional Distance Learning Program
Certified Quality Professional Distance Learning ProgramCertified Quality Professional Distance Learning Program
Certified Quality Professional Distance Learning Program
Vin Williams
 
Enablers & Enhancers Quality posters
Enablers & Enhancers Quality postersEnablers & Enhancers Quality posters
Enablers & Enhancers Quality posters
Vin Williams
 
Presentación1 funcion de supervision
Presentación1 funcion de supervisionPresentación1 funcion de supervision
Presentación1 funcion de supervision
leslimar paradas
 
Brochure 5s
Brochure 5sBrochure 5s
Brochure 5s
Vin Williams
 
Certified Quality Professional Specialization in Healthcare Quality
Certified Quality Professional Specialization in Healthcare QualityCertified Quality Professional Specialization in Healthcare Quality
Certified Quality Professional Specialization in Healthcare Quality
Vin Williams
 
Tameer bank
Tameer bankTameer bank
Tameer bank
Mudassir Raza
 
How Social Networking Is Making Us Antisocial
How Social Networking Is Making Us AntisocialHow Social Networking Is Making Us Antisocial
How Social Networking Is Making Us Antisocial
Kelsey Elchuk
 
5S LEAN- CERTIFIED PROFESSIONAL & LEAD AUDITOR COURSE AT QPG
5S LEAN- CERTIFIED PROFESSIONAL & LEAD AUDITOR COURSE AT QPG5S LEAN- CERTIFIED PROFESSIONAL & LEAD AUDITOR COURSE AT QPG
5S LEAN- CERTIFIED PROFESSIONAL & LEAD AUDITOR COURSE AT QPG
Vin Williams
 

Viewers also liked (9)

Certified quality professional
Certified quality professionalCertified quality professional
Certified quality professional
 
Certified Quality Professional Distance Learning Program
Certified Quality Professional Distance Learning ProgramCertified Quality Professional Distance Learning Program
Certified Quality Professional Distance Learning Program
 
Enablers & Enhancers Quality posters
Enablers & Enhancers Quality postersEnablers & Enhancers Quality posters
Enablers & Enhancers Quality posters
 
Presentación1 funcion de supervision
Presentación1 funcion de supervisionPresentación1 funcion de supervision
Presentación1 funcion de supervision
 
Brochure 5s
Brochure 5sBrochure 5s
Brochure 5s
 
Certified Quality Professional Specialization in Healthcare Quality
Certified Quality Professional Specialization in Healthcare QualityCertified Quality Professional Specialization in Healthcare Quality
Certified Quality Professional Specialization in Healthcare Quality
 
Tameer bank
Tameer bankTameer bank
Tameer bank
 
How Social Networking Is Making Us Antisocial
How Social Networking Is Making Us AntisocialHow Social Networking Is Making Us Antisocial
How Social Networking Is Making Us Antisocial
 
5S LEAN- CERTIFIED PROFESSIONAL & LEAD AUDITOR COURSE AT QPG
5S LEAN- CERTIFIED PROFESSIONAL & LEAD AUDITOR COURSE AT QPG5S LEAN- CERTIFIED PROFESSIONAL & LEAD AUDITOR COURSE AT QPG
5S LEAN- CERTIFIED PROFESSIONAL & LEAD AUDITOR COURSE AT QPG
 

Similar to Pass the message with RabbitMQ

FrameMaker and numbering
FrameMaker and numberingFrameMaker and numbering
FrameMaker and numbering
Publishing Smarter
 
Room101 mailshots
Room101 mailshotsRoom101 mailshots
Room101 mailshots
Room 101 Limited
 
Slash n near real time indexing
Slash n   near real time indexingSlash n   near real time indexing
Slash n near real time indexing
Umesh Prasad
 
How we built an event-time merge of two kafka-streams with spark-streaming
How we built an event-time merge of two kafka-streams with spark-streamingHow we built an event-time merge of two kafka-streams with spark-streaming
How we built an event-time merge of two kafka-streams with spark-streaming
Ralf Sigmund
 
Vertical response 101
Vertical response 101Vertical response 101
Vertical response 101
Idealist Consulting
 
near real time search in e-commerce
near real time search in e-commerce  near real time search in e-commerce
near real time search in e-commerce
Umesh Prasad
 
Bt0078, website design
Bt0078, website designBt0078, website design
Bt0078, website design
smumbahelp
 
Convert MBOX to PST
Convert MBOX to PSTConvert MBOX to PST
Convert MBOX to PST
John Ric
 
Visual basic intoduction
Visual basic intoductionVisual basic intoduction
Visual basic intoduction
Spy Seat
 
Database DevOps for Managed Service Providers
Database DevOps for Managed Service ProvidersDatabase DevOps for Managed Service Providers
Database DevOps for Managed Service Providers
Red Gate Software
 
Building an english based rules engine
Building an english based rules engineBuilding an english based rules engine
Building an english based rules engine
keithelder
 
Mail merge
Mail mergeMail merge
Mail merge
Mahine636
 
Messaging Powered Front Ends
Messaging Powered Front EndsMessaging Powered Front Ends
Messaging Powered Front Ends
Elton Stoneman
 
Visual basic
Visual basicVisual basic
Visual basic
pavishkumarsingh
 
Microservices and Azure App Services
Microservices and Azure App ServicesMicroservices and Azure App Services
Microservices and Azure App Services
Damir Dobric
 

Similar to Pass the message with RabbitMQ (15)

FrameMaker and numbering
FrameMaker and numberingFrameMaker and numbering
FrameMaker and numbering
 
Room101 mailshots
Room101 mailshotsRoom101 mailshots
Room101 mailshots
 
Slash n near real time indexing
Slash n   near real time indexingSlash n   near real time indexing
Slash n near real time indexing
 
How we built an event-time merge of two kafka-streams with spark-streaming
How we built an event-time merge of two kafka-streams with spark-streamingHow we built an event-time merge of two kafka-streams with spark-streaming
How we built an event-time merge of two kafka-streams with spark-streaming
 
Vertical response 101
Vertical response 101Vertical response 101
Vertical response 101
 
near real time search in e-commerce
near real time search in e-commerce  near real time search in e-commerce
near real time search in e-commerce
 
Bt0078, website design
Bt0078, website designBt0078, website design
Bt0078, website design
 
Convert MBOX to PST
Convert MBOX to PSTConvert MBOX to PST
Convert MBOX to PST
 
Visual basic intoduction
Visual basic intoductionVisual basic intoduction
Visual basic intoduction
 
Database DevOps for Managed Service Providers
Database DevOps for Managed Service ProvidersDatabase DevOps for Managed Service Providers
Database DevOps for Managed Service Providers
 
Building an english based rules engine
Building an english based rules engineBuilding an english based rules engine
Building an english based rules engine
 
Mail merge
Mail mergeMail merge
Mail merge
 
Messaging Powered Front Ends
Messaging Powered Front EndsMessaging Powered Front Ends
Messaging Powered Front Ends
 
Visual basic
Visual basicVisual basic
Visual basic
 
Microservices and Azure App Services
Microservices and Azure App ServicesMicroservices and Azure App Services
Microservices and Azure App Services
 

Recently uploaded

How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
Chart Kalyan
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
Matthew Sinclair
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
akankshawande
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
danishmna97
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
Tatiana Kojar
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Tosin Akinosho
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
kumardaparthi1024
 
WeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation TechniquesWeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation Techniques
Postman
 
Project Management Semester Long Project - Acuity
Project Management Semester Long Project - AcuityProject Management Semester Long Project - Acuity
Project Management Semester Long Project - Acuity
jpupo2018
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
Edge AI and Vision Alliance
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Speck&Tech
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
Zilliz
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
名前 です男
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
panagenda
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
Zilliz
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
Pixlogix Infotech
 
Webinar: Designing a schema for a Data Warehouse
Webinar: Designing a schema for a Data WarehouseWebinar: Designing a schema for a Data Warehouse
Webinar: Designing a schema for a Data Warehouse
Federico Razzoli
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
Ivanti
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
shyamraj55
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
Mariano Tinti
 

Recently uploaded (20)

How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
 
WeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation TechniquesWeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation Techniques
 
Project Management Semester Long Project - Acuity
Project Management Semester Long Project - AcuityProject Management Semester Long Project - Acuity
Project Management Semester Long Project - Acuity
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
 
Webinar: Designing a schema for a Data Warehouse
Webinar: Designing a schema for a Data WarehouseWebinar: Designing a schema for a Data Warehouse
Webinar: Designing a schema for a Data Warehouse
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
 

Pass the message with RabbitMQ

Editor's Notes

  1. Queue First In – First Out data structure Producers and Consumers Messages are retrieved in the same order they are put on the queue. Producer doesn’t know or care when the Consumer processes the message
  2. Producers and Consumers Messages are retrieved in the same order they are put on the queue. Producer doesn’t know or care when the Consumer processes the message
  3. Server hosting one or more message queues MSMQ = Store and Forward
  4. Nothing stops you from publishing images, videos etc. But usually better to publish a reference. MSMQ limit is 4MB
  5. Good for scaling resource-intensive work
  6. Good for publishing events or notifications
  7. All queues by default bind to the ”” (unnamed) exchange