SlideShare una empresa de Scribd logo
1 de 20
Descargar para leer sin conexión
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

Más contenido relacionado

Similar a 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 SamplesStormMQ
 
Azure Service Bus Performance Checklist
Azure Service Bus Performance ChecklistAzure Service Bus Performance Checklist
Azure Service Bus Performance ChecklistSalim M Bhonhariya
 
Iot hub agent
Iot hub agentIot hub agent
Iot hub agentrtfmpliz1
 
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 Foundationredaxe12
 
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 2013Dominik Obermaier
 
Building scalable network applications with Netty
Building scalable network applications with NettyBuilding scalable network applications with Netty
Building scalable network applications with NettyNLJUG
 
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
 
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 thingsAlon Pe'er
 
Kamaelia Protocol Walkthrough
Kamaelia Protocol WalkthroughKamaelia Protocol Walkthrough
Kamaelia Protocol Walkthroughkamaelian
 
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. SaxDatabricks
 
Type-Safe Evolution of 
Web Services
Type-Safe Evolution of 
Web ServicesType-Safe Evolution of 
Web Services
Type-Safe Evolution of 
Web ServicesJácome Cunha
 
Type-Safe Evolution of 
Web Services
Type-Safe Evolution of 
Web ServicesType-Safe Evolution of 
Web Services
Type-Safe Evolution of 
Web Servicesjacomecunha
 
Svcc2009 Async Ws
Svcc2009 Async WsSvcc2009 Async Ws
Svcc2009 Async WsManoj Kumar
 
PowerChain - Blockchain 4 Energy
PowerChain - Blockchain 4 EnergyPowerChain - Blockchain 4 Energy
PowerChain - Blockchain 4 EnergyThorsten 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.docxwkyra78
 
Rabbit MQ introduction
Rabbit MQ introductionRabbit MQ introduction
Rabbit MQ introductionSitg Yao
 

Similar a 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
Building scalable network applications with NettyBuilding scalable network applications with Netty
Building scalable network applications with Netty
 
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...
 
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
 
Spring integration
Spring integrationSpring integration
Spring integration
 
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
 

Último

Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...apidays
 
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, Adobeapidays
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
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...DianaGray10
 
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 WoodJuan lago vázquez
 
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 FMESafe Software
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbuapidays
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024The Digital Insurer
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 

Último (20)

Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
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
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
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...
 
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
 
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
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 

Geeky.week3.rabbitmq