SlideShare ist ein Scribd-Unternehmen logo
1 von 28
Messaging System with
RabbitMQ & Spring Boot
Firman .
Without Messaging System
● To many integrations point and different implementation like:
○ Data protokol: data link / Api / Files/Ftp
○ Data Format: JSON / CSV / XML
○ Need to maintain the connections
App 1 App 2 App 3 App 4
App 5 App 6 App 7 App 8
RabbitMQ
App 1 App 2 App 3 App 4
App 5 App 6 App 7 App 8
Messaging System
Basic Concepts
Queue & Exchange
1. Queue :
Is a line that store message
1. Exchanges :
Routing message to Queue
1. Routing Key :
A key that the exchange looks
to decide how to route the
message to queue
1. Binding :
A link between exchange to
queue
Exchanges
1. Fanout Exchange
2. Direct Exchange
3. Topic Exchange
….
Fanout
Multiple
queues
for single
message
Direct
Send to
selective queue
with Single
Criteria routing
Topic
Send to
selective queue
with multiple
Criteria routing
Topic RabbitMQ Rules
Key and Message
that sent to RabbitMQ
Topic
Exchange
Routing Key
(using wild
card)
Queues
Routing Key
(source.size.type)
JSON Data
x.picture
mobile.# q.picture.mobile mobile.small.jpg
{
"name": "Picture0",
"type": "jpg",
"source": "mobile",
"size": "small"
}
*.*.svg q.picture.vector web.large.svg
{
"name": "Picture5",
"type": "svg",
"source": "web",
"size": "large"
}
*.large.svg q.picture.large web.large.svg
{
"name": "Picture5",
"type": "svg",
"source": "web",
"size": "large"
}
How to Create Exchange
How to Create Queue
How to Bind Exchange and the Queues
Spring Boot : Dependencies & Properties
build.gradle
pom.xml
application.yml
Spring Boot : Producer (Type: Direct Exchange)
Spring Boot : Consumer
RabbitMQ : Messages
Spring Boot : Log Producer
Spring Boot : Log Consumer
Handling Exception on Consumer
1. DLX (Dead Letter Exchange)
2. TTL (Time to Live)
….
DLX (Dead Letter Exchange)
● Exception might happened
● Spring will re-queue by default
● ….
TTL (Time to Live)
● Set time to live for the Queue
● When there’s no consumer, it will
gone
● ….
How to Implement DLX
Create 2 Exchanges:
Create 2 Queues:
Normal queue,
for dead letter
queue
Binding the DLX
How to Implement TTL
Create the Queue with argument Message TTL and set it 10 seconds (10.000 ms)
Manual Acknowledge
Update Application.yml
Will go to DLX if
we define the
DLX, else the
queue just gone
Will rem0ve the
queue or the
queue is done
Spring by default will automatically Ack.
But when we have THROWS Exception,
the consumer will consume invalid message with
infinite loop.
Retry Mechanism (when consume the Queue)
View log on Gist
Consume Log Time Time Diff (s)
First 2020-08-09 19:02:47.928 0s
Second 2020-08-09 19:02:50.943 3s (3x1)
Third 2020-08-09 19:02:56.945 6s (3x2)
Fourth 2020-08-09 19:03:06.951 10s (max-interval)
Fifth 2020-08-09 19:03:16.954 10s (max-interval)
well done, thanks
...

Weitere ähnliche Inhalte

Was ist angesagt? (8)

communication among tasks in advanced system architecture
communication among tasks in advanced system architecturecommunication among tasks in advanced system architecture
communication among tasks in advanced system architecture
 
Using message queues for distributed computing on Kubernetes
Using message queues for distributed computing on KubernetesUsing message queues for distributed computing on Kubernetes
Using message queues for distributed computing on Kubernetes
 
Stackless Python In Eve
Stackless Python In EveStackless Python In Eve
Stackless Python In Eve
 
Post-Quantum Dev Ops
Post-Quantum Dev OpsPost-Quantum Dev Ops
Post-Quantum Dev Ops
 
Google Spanner
Google SpannerGoogle Spanner
Google Spanner
 
Resource element lte explanations!
Resource element lte explanations!Resource element lte explanations!
Resource element lte explanations!
 
Workshop 05 Review
Workshop 05 ReviewWorkshop 05 Review
Workshop 05 Review
 
Distributed System by Pratik Tambekar
Distributed System by Pratik TambekarDistributed System by Pratik Tambekar
Distributed System by Pratik Tambekar
 

Ähnlich wie Messaging System with Spring Boot dan RabbitMQ

Enterprise Messaging with RabbitMQ.pdf
Enterprise Messaging with RabbitMQ.pdfEnterprise Messaging with RabbitMQ.pdf
Enterprise Messaging with RabbitMQ.pdf
Ortus Solutions, Corp
 
The Art of Message Queues - TEKX
The Art of Message Queues - TEKXThe Art of Message Queues - TEKX
The Art of Message Queues - TEKX
Mike Willbanks
 
rabbitmq-230309090159-74df501353w553.pdf
rabbitmq-230309090159-74df501353w553.pdfrabbitmq-230309090159-74df501353w553.pdf
rabbitmq-230309090159-74df501353w553.pdf
ndonikristi98
 
High powered messaging with RabbitMQ
High powered messaging with RabbitMQHigh powered messaging with RabbitMQ
High powered messaging with RabbitMQ
James Carr
 

Ähnlich wie Messaging System with Spring Boot dan RabbitMQ (20)

Chat app case study - xmpp vs SIP
Chat app case study - xmpp vs SIPChat app case study - xmpp vs SIP
Chat app case study - xmpp vs SIP
 
UNIT V - The OMG way-system object model Notes.ppt
UNIT V - The OMG way-system object model Notes.pptUNIT V - The OMG way-system object model Notes.ppt
UNIT V - The OMG way-system object model Notes.ppt
 
Real time-embedded-system-lec-06
Real time-embedded-system-lec-06Real time-embedded-system-lec-06
Real time-embedded-system-lec-06
 
ipc.pptx
ipc.pptxipc.pptx
ipc.pptx
 
Building your First gRPC Service
Building your First gRPC ServiceBuilding your First gRPC Service
Building your First gRPC Service
 
[@NaukriEngineering] Messaging Queues
[@NaukriEngineering] Messaging Queues[@NaukriEngineering] Messaging Queues
[@NaukriEngineering] Messaging Queues
 
Enterprise Messaging with RabbitMQ.pdf
Enterprise Messaging with RabbitMQ.pdfEnterprise Messaging with RabbitMQ.pdf
Enterprise Messaging with RabbitMQ.pdf
 
Interledger Protocol Stack Deep Dive @ Boston Interledger Meetup
Interledger Protocol Stack Deep Dive @ Boston Interledger MeetupInterledger Protocol Stack Deep Dive @ Boston Interledger Meetup
Interledger Protocol Stack Deep Dive @ Boston Interledger Meetup
 
Comparison of mqtt and coap protocol
Comparison of mqtt and coap protocolComparison of mqtt and coap protocol
Comparison of mqtt and coap protocol
 
13 tm adv
13 tm adv13 tm adv
13 tm adv
 
The Art of Message Queues - TEKX
The Art of Message Queues - TEKXThe Art of Message Queues - TEKX
The Art of Message Queues - TEKX
 
Intranet Messaging Project Report -phpapp02
Intranet Messaging Project Report -phpapp02Intranet Messaging Project Report -phpapp02
Intranet Messaging Project Report -phpapp02
 
Ipc
IpcIpc
Ipc
 
What I learned about APIs in my first year at Google
What I learned about APIs in my first year at GoogleWhat I learned about APIs in my first year at Google
What I learned about APIs in my first year at Google
 
RabbitMQ.ppt
RabbitMQ.pptRabbitMQ.ppt
RabbitMQ.ppt
 
rabbitmq-230309090159-74df501353w553.pdf
rabbitmq-230309090159-74df501353w553.pdfrabbitmq-230309090159-74df501353w553.pdf
rabbitmq-230309090159-74df501353w553.pdf
 
C* Summit 2013: Time is Money Jake Luciani and Carl Yeksigian
C* Summit 2013: Time is Money Jake Luciani and Carl YeksigianC* Summit 2013: Time is Money Jake Luciani and Carl Yeksigian
C* Summit 2013: Time is Money Jake Luciani and Carl Yeksigian
 
High powered messaging with RabbitMQ
High powered messaging with RabbitMQHigh powered messaging with RabbitMQ
High powered messaging with RabbitMQ
 
AMQP with RabbitMQ
AMQP with RabbitMQAMQP with RabbitMQ
AMQP with RabbitMQ
 
Introduction and Overview of Apache Kafka, TriHUG July 23, 2013
Introduction and Overview of Apache Kafka, TriHUG July 23, 2013Introduction and Overview of Apache Kafka, TriHUG July 23, 2013
Introduction and Overview of Apache Kafka, TriHUG July 23, 2013
 

Kürzlich hochgeladen

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 

Kürzlich hochgeladen (20)

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 

Messaging System with Spring Boot dan RabbitMQ