SlideShare a Scribd company logo
RabbitMQ
3th WEEK
SATURDAY, JULY 06, 2013 – SUNDAY, JULY 07, 2013
GEEK ACADEMY 2013
RABBITMQ
GEEK ACADEMY 2013
MQ History
1985 1993
TIB IBM MQSeries RabbitMQ
2006
A
B
C
D
E
Consumers
Producers
Broker
Exchanges
Queues
F
G
H
I
J
Bindings
Channel
Direct Exchange
Fanout Exchange
Topic Exchange
KEY WORDS
01. EXCHANGES
Exchanges are where producers publish their messages.
02. QUEUES
Queues are where the messages end up and are received by consumers.
03. BINDINDS
Bindings are how the messages get routed from the exchange to
particular queues
AMQP ELEMENTS
CONSUMERS AND PRODUCERS
10
%
100
%
10
%
10%
10
%
10
%
10%
NOT ABOUT
ECONOMICS
AM LP CM KM YH R M HT
Producers create messages and publish (send)
them to a broker server. Then the broker will
determine who(consumers) should get a copy of
messages.
Message = Payload + Label
FLOWS
MessageProducer Exchange
QueueBinding Consumer
"lightweight connections
that share a single TCP
connection".
CHANNELS
What?
DEFAULT EXCHANGE
producer broker consumer
consumer
consumer
geeky2
geeky1
geeky3
Demo
ConnectionFactory factory = new ConnectionFactory();
factory.setHost(RABBITMQ_HOST);
Connection connection = factory.newConnection();
Channel channel = connection.createChannel();
boolean durable = true;
channel.queueDeclare(queue, durable, false, isAutoDelete, null);
Producer:
o channel.basicPublish( "", queue, null, message.getBytes());
Consumer:
o QueueingConsumer consumer = new QueueingConsumer(channel);
o channel.basicConsume(queue, autoAck, consumer);
o QueueingConsumer.Delivery delivery = consumer.nextDelivery();
o String message = new String(delivery.getBody());
DIRECT EXCHANGE
producer broker
consumer
consumer
geeky.jvm
geeky.groovy
geeky.jvm
geeky.java
Demo
ConnectionFactory factory = new ConnectionFactory();
factory.setHost(RABBITMQ_HOST);
Connection connection = factory.newConnection();
Channel channel = connection.createChannel();
channel.exchangeDeclare(EXCHANGE_NAME, "direct");
Producer:
o channel.basicPublish( exchangeName, serevity, null, message.getBytes());
Consumer:
o channel.queueBind(queueName, EXCHANGE_NAME, severity);
o QueueingConsumer consumer = new QueueingConsumer(channel);
o channel.basicConsume(queue, autoAck, consumer);
o QueueingConsumer.Delivery delivery = consumer.nextDelivery();
o String message = new String(delivery.getBody());
FANOUT EXCHANGE
producer broker consumer
consumer
consumer
Hello
geeky
Hello
geeky
Hellogeeky
Demo
ConnectionFactory factory = new ConnectionFactory();
factory.setHost(RABBITMQ_HOST);
Connection connection = factory.newConnection();
Channel channel = connection.createChannel();
channel.exchangeDeclare(EXCHANGE_NAME, "fanout");
Producer:
o channel.basicPublish( EXCHANGE_NAME, "", null, message.getBytes());
Consumer:
o String queueName = channel.queueDeclare().getQueue();
o channel.queueBind(queueName, EXCHANGE_NAME, "");
o QueueingConsumer consumer = new QueueingConsumer(channel);
o channel.basicConsume(queue, isAck, consumer);
o QueueingConsumer.Delivery delivery = consumer.nextDelivery();
o String message = new String(delivery.getBody());
TOPIC EXCHANGE
producer broker consumer
consumer
consumer
geeky.#
*.java.*
*.groovy.*
*.*.spring
Demo
ConnectionFactory factory = new ConnectionFactory();
factory.setHost(RABBITMQ_HOST);
Connection connection = factory.newConnection();
Channel channel = connection.createChannel();
boolean durable = true;
channel.exchangeDeclare(EXCHANGE_NAME, "topic");
Producer:
o channel.basicPublish( EXCHANGE_NAME, routingKey, null,
message.getBytes());
Consumer:
o String queueName = channel.queueDeclare().getQueue();
o channel.queueBind(queueName, EXCHANGE_NAME, bindingKey);
o QueueingConsumer consumer = new QueueingConsumer(channel);
o channel.basicConsume(queue, isAck, consumer);
o QueueingConsumer.Delivery delivery = consumer.nextDelivery();
o String message = new String(delivery.getBody());
Rabbitmqctl
o rabbitmqctl start
o rabbitmqctl stop
o rabbitmqctl list_queues
o rabbitmqctl list_exchanges
o rabbitmqctl list_bindings
o rabbitmqctl list_users
o rabbitmqctl add_user [username] [password]
o rabbitmqctl delete_user [username]
o rabbitmqctl changepassword [username] [new password]
01. http://www.springsource.org/spring-amqp
03.http://www.rabbitmq.com
04.http://hg.rabbitmq.com/rabbitmq-java-client/
READ MORE...
02.https://github.com/SpringSource/spring-amqp
05.https://github.com/up1/geeky_week3_demo
GEEK ACADEMY 2013
THANK YOU FOR
YOUR TIME
GEEK ACADEMY 2013

More Related Content

Similar to Geeky.week3.rabbitmq

An Introduction to AMQP with Code Samples
An Introduction to AMQP with Code SamplesAn Introduction to AMQP with Code Samples
An Introduction to AMQP with Code Samples
StormMQ
 
Azure Service Bus Performance Checklist
Azure Service Bus Performance ChecklistAzure Service Bus Performance Checklist
Azure Service Bus Performance Checklist
Salim M Bhonhariya
 
Iot hub agent
Iot hub agentIot hub agent
Iot hub agent
rtfmpliz1
 
IRJET- Development of Android Application for Device to Device Communication ...
IRJET- Development of Android Application for Device to Device Communication ...IRJET- Development of Android Application for Device to Device Communication ...
IRJET- Development of Android Application for Device to Device Communication ...
IRJET Journal
 
introduction to Windows Comunication Foundation
introduction to Windows Comunication Foundationintroduction to Windows Comunication Foundation
introduction to Windows Comunication Foundation
redaxe12
 
WCF for begineers
WCF  for begineersWCF  for begineers
WCF for begineers
Dhananjay Kumar
 
M2M for Java Developers: MQTT with Eclipse Paho - Eclipsecon Europe 2013
M2M for Java Developers: MQTT with Eclipse Paho - Eclipsecon Europe 2013M2M for Java Developers: MQTT with Eclipse Paho - Eclipsecon Europe 2013
M2M for Java Developers: MQTT with Eclipse Paho - Eclipsecon Europe 2013
Dominik Obermaier
 
Building scalable network applications with Netty (as presented on NLJUG JFal...
Building scalable network applications with Netty (as presented on NLJUG JFal...Building scalable network applications with Netty (as presented on NLJUG JFal...
Building scalable network applications with Netty (as presented on NLJUG JFal...
Jaap ter Woerds
 
Building scalable network applications with Netty
Building scalable network applications with NettyBuilding scalable network applications with Netty
Building scalable network applications with Netty
NLJUG
 
David Wang's Presentation at Emerging Communication Conference & Awards 2009 ...
David Wang's Presentation at Emerging Communication Conference & Awards 2009 ...David Wang's Presentation at Emerging Communication Conference & Awards 2009 ...
David Wang's Presentation at Emerging Communication Conference & Awards 2009 ...
eCommConf
 
Move fast and consumer driven contract test things
Move fast and consumer driven contract test thingsMove fast and consumer driven contract test things
Move fast and consumer driven contract test things
Alon Pe'er
 
Kamaelia Protocol Walkthrough
Kamaelia Protocol WalkthroughKamaelia Protocol Walkthrough
Kamaelia Protocol Walkthrough
kamaelian
 
Introducing Exactly Once Semantics in Apache Kafka with Matthias J. Sax
Introducing Exactly Once Semantics in Apache Kafka with Matthias J. SaxIntroducing Exactly Once Semantics in Apache Kafka with Matthias J. Sax
Introducing Exactly Once Semantics in Apache Kafka with Matthias J. Sax
Databricks
 
Type-Safe Evolution of 
Web Services
Type-Safe Evolution of 
Web ServicesType-Safe Evolution of 
Web Services
Type-Safe Evolution of 
Web Services
Jácome Cunha
 
Type-Safe Evolution of 
Web Services
Type-Safe Evolution of 
Web ServicesType-Safe Evolution of 
Web Services
Type-Safe Evolution of 
Web Services
jacomecunha
 
Svcc2009 Async Ws
Svcc2009 Async WsSvcc2009 Async Ws
Svcc2009 Async Ws
Manoj Kumar
 
PowerChain - Blockchain 4 Energy
PowerChain - Blockchain 4 EnergyPowerChain - Blockchain 4 Energy
PowerChain - Blockchain 4 Energy
Thorsten Zoerner
 
Project 4 (P4) Distance Vector Routing (DV)Instructor Dr.docx
Project 4 (P4) Distance Vector Routing (DV)Instructor Dr.docxProject 4 (P4) Distance Vector Routing (DV)Instructor Dr.docx
Project 4 (P4) Distance Vector Routing (DV)Instructor Dr.docx
wkyra78
 
Rabbit MQ introduction
Rabbit MQ introductionRabbit MQ introduction
Rabbit MQ introduction
Sitg Yao
 
Js remote conf
Js remote confJs remote conf
Js remote conf
Bart Wood
 

Similar to Geeky.week3.rabbitmq (20)

An Introduction to AMQP with Code Samples
An Introduction to AMQP with Code SamplesAn Introduction to AMQP with Code Samples
An Introduction to AMQP with Code Samples
 
Azure Service Bus Performance Checklist
Azure Service Bus Performance ChecklistAzure Service Bus Performance Checklist
Azure Service Bus Performance Checklist
 
Iot hub agent
Iot hub agentIot hub agent
Iot hub agent
 
IRJET- Development of Android Application for Device to Device Communication ...
IRJET- Development of Android Application for Device to Device Communication ...IRJET- Development of Android Application for Device to Device Communication ...
IRJET- Development of Android Application for Device to Device Communication ...
 
introduction to Windows Comunication Foundation
introduction to Windows Comunication Foundationintroduction to Windows Comunication Foundation
introduction to Windows Comunication Foundation
 
WCF for begineers
WCF  for begineersWCF  for begineers
WCF for begineers
 
M2M for Java Developers: MQTT with Eclipse Paho - Eclipsecon Europe 2013
M2M for Java Developers: MQTT with Eclipse Paho - Eclipsecon Europe 2013M2M for Java Developers: MQTT with Eclipse Paho - Eclipsecon Europe 2013
M2M for Java Developers: MQTT with Eclipse Paho - Eclipsecon Europe 2013
 
Building scalable network applications with Netty (as presented on NLJUG JFal...
Building scalable network applications with Netty (as presented on NLJUG JFal...Building scalable network applications with Netty (as presented on NLJUG JFal...
Building scalable network applications with Netty (as presented on NLJUG JFal...
 
Building scalable network applications with Netty
Building scalable network applications with NettyBuilding scalable network applications with Netty
Building scalable network applications with Netty
 
David Wang's Presentation at Emerging Communication Conference & Awards 2009 ...
David Wang's Presentation at Emerging Communication Conference & Awards 2009 ...David Wang's Presentation at Emerging Communication Conference & Awards 2009 ...
David Wang's Presentation at Emerging Communication Conference & Awards 2009 ...
 
Move fast and consumer driven contract test things
Move fast and consumer driven contract test thingsMove fast and consumer driven contract test things
Move fast and consumer driven contract test things
 
Kamaelia Protocol Walkthrough
Kamaelia Protocol WalkthroughKamaelia Protocol Walkthrough
Kamaelia Protocol Walkthrough
 
Introducing Exactly Once Semantics in Apache Kafka with Matthias J. Sax
Introducing Exactly Once Semantics in Apache Kafka with Matthias J. SaxIntroducing Exactly Once Semantics in Apache Kafka with Matthias J. Sax
Introducing Exactly Once Semantics in Apache Kafka with Matthias J. Sax
 
Type-Safe Evolution of 
Web Services
Type-Safe Evolution of 
Web ServicesType-Safe Evolution of 
Web Services
Type-Safe Evolution of 
Web Services
 
Type-Safe Evolution of 
Web Services
Type-Safe Evolution of 
Web ServicesType-Safe Evolution of 
Web Services
Type-Safe Evolution of 
Web Services
 
Svcc2009 Async Ws
Svcc2009 Async WsSvcc2009 Async Ws
Svcc2009 Async Ws
 
PowerChain - Blockchain 4 Energy
PowerChain - Blockchain 4 EnergyPowerChain - Blockchain 4 Energy
PowerChain - Blockchain 4 Energy
 
Project 4 (P4) Distance Vector Routing (DV)Instructor Dr.docx
Project 4 (P4) Distance Vector Routing (DV)Instructor Dr.docxProject 4 (P4) Distance Vector Routing (DV)Instructor Dr.docx
Project 4 (P4) Distance Vector Routing (DV)Instructor Dr.docx
 
Rabbit MQ introduction
Rabbit MQ introductionRabbit MQ introduction
Rabbit MQ introduction
 
Js remote conf
Js remote confJs remote conf
Js remote conf
 

Recently uploaded

Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
Brandon Minnick, MBA
 
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
 
System Design Case Study: Building a Scalable E-Commerce Platform - Hiike
System Design Case Study: Building a Scalable E-Commerce Platform - HiikeSystem Design Case Study: Building a Scalable E-Commerce Platform - Hiike
System Design Case Study: Building a Scalable E-Commerce Platform - Hiike
Hiike
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc
 
AWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptxAWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptx
HarisZaheer8
 
Operating System Used by Users in day-to-day life.pptx
Operating System Used by Users in day-to-day life.pptxOperating System Used by Users in day-to-day life.pptx
Operating System Used by Users in day-to-day life.pptx
Pravash Chandra Das
 
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying AheadDigital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Wask
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
kumardaparthi1024
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
Zilliz
 
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
 
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
 
Trusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process MiningTrusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process Mining
LucaBarbaro3
 
UI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentationUI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentation
Wouter Lemaire
 
dbms calicut university B. sc Cs 4th sem.pdf
dbms  calicut university B. sc Cs 4th sem.pdfdbms  calicut university B. sc Cs 4th sem.pdf
dbms calicut university B. sc Cs 4th sem.pdf
Shinana2
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
ssuserfac0301
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
DanBrown980551
 
Deep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStr
Deep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStrDeep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStr
Deep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStr
saastr
 
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
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
Tomaz Bratanic
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 

Recently uploaded (20)

Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
 
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
 
System Design Case Study: Building a Scalable E-Commerce Platform - Hiike
System Design Case Study: Building a Scalable E-Commerce Platform - HiikeSystem Design Case Study: Building a Scalable E-Commerce Platform - Hiike
System Design Case Study: Building a Scalable E-Commerce Platform - Hiike
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
 
AWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptxAWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptx
 
Operating System Used by Users in day-to-day life.pptx
Operating System Used by Users in day-to-day life.pptxOperating System Used by Users in day-to-day life.pptx
Operating System Used by Users in day-to-day life.pptx
 
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying AheadDigital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying Ahead
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
 
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
 
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
 
Trusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process MiningTrusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process Mining
 
UI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentationUI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentation
 
dbms calicut university B. sc Cs 4th sem.pdf
dbms  calicut university B. sc Cs 4th sem.pdfdbms  calicut university B. sc Cs 4th sem.pdf
dbms calicut university B. sc Cs 4th sem.pdf
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
 
Deep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStr
Deep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStrDeep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStr
Deep Dive: Getting Funded with Jason Jason Lemkin Founder & CEO @ SaaStr
 
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
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 

Geeky.week3.rabbitmq