SlideShare a Scribd company logo
1 of 20
Download to read offline
Addressing Messaging Challenges Using Spring and RabbitMQ
© 2012 SpringOne 2GX. All rights reserved. Do not distribute without permission.
Gary Russell, Staff Engineer, SpringSource; @gprussell
Addressing Messaging Challenges
•  Modern Application Trends
•  Modularize with Spring Integration
•  Distribute with AMQP
•  Analyze with Hadoop
2
Place
Order
Fulfill
Order
Manage
Inventory
Schedule
Delivery
If any component is unavailable within this synchronous flow, all
in-flight messages will be affected, regardless of what
component they are currently in -- and since state is maintained
across the components, the system can be complex to reset
X
X
X
X
X
X
X
X
X
An exception
occurred,
please resend
Synchronous Architecture is Brittle
3
In this asynchronous flow:
•  all state is kept in the simple messages being passed
•  each stateless component interacts only with the broker cloud
•  if a component is lost, only the in-flight messages within that
component must be re-delivered
•  components can be quickly provisioned on-demand
I have an
Order
I can fulfill
part of that
Order
I’ll schedule
delivery of that
order
I can fulfill
part of that
OrderYour order will
be delivered
next Tuesday
The status of
your order is
…
Asynchronous Architecture Rules the Web
4
Modern approaches to messaging
embrace the unpredictable,
dynamic, and transient nature of
the web
Traditional approaches to
messaging imply predictable,
static interaction between well-
known end-points
Modern Applications Need Modern Messaging
5
Modularize with Spring Integration
•  At the core, an embedded Message Bus
–  Inspired by Gregor Hohpe and Bobby Woolf's Enterprise
Integration Patterns (2003)
–  Runs within any Spring ApplicationContext
–  All components are Spring-managed objects
•  Also, an Application Integration Framework
–  Connects to other systems via adapters
–  Unidirectional Channel Adapters
–  Bidirectional Messaging Gateways
What is Spring Integration?
7
cafe
orders
drinks
coldDrinks
hotDrinks
preparedDrinks
deliveries
CafeDemoApp
Spring Integration Cafe
8
Café
http
Spring Integration Café – Simple HTTP Deployment
9
Distribute with AMQP
10
A	
  Protocol,	
  not	
  an	
  API	
  
•  A	
  defined	
  set	
  of	
  messaging	
  
capabili2es	
  called	
  the	
  AMQ	
  
model	
  
•  A	
  network	
  wire-­‐level	
  
protocol,	
  AMQP	
  
On	
  commodity	
  hardware	
  
•  10-­‐25	
  thousand	
  messages	
  
per	
  second	
  is	
  rou@ne	
  *	
  
•  The	
  NIC	
  is	
  usually	
  the	
  
boFleneck	
  
	
  
*	
  Non-­‐persistent	
  messages	
  
Why AMQP?
11
AMQP	
  security	
  
•  Brokers	
  support	
  separate	
  
virtual	
  hosts	
  
•  Three	
  levels	
  of	
  permissions	
  
•  AMQP	
  over	
  SSL	
  is	
  supported	
  
Designed	
  to	
  scale	
  horizontally	
  
•  Dozens	
  of	
  clustered	
  brokers	
  
are	
  common	
  
Why AMQP?
12
new.order
queue
M3M1 M2new.order
binding
new.order
routing key
AMQP Architecture
13
café NA deliveries
queue
café deliveries
queue
M3M1 M2
M3M1 M2
café WW deliveries
queue
M3M1 M2
AMQP Architecture
14
hot_drinks
queue
cold_drinks
queue
1 2
2
3
1
drink.cold
Message Routing Keys:
1.  drink.hot
2.  drink.cold
3.  drink.warm
all_drinks
queue
AMQP Architecture
15
Spring-AMQP
•  AMQP core abstraction plus RabbitMQ implementation (built on rabbit
client libraries)
•  Higher level patterns for clients: admin, producers and consumers
–  RabbitAdmin – declare exchanges, queues, bindings
–  RabbitTemplate – convenience methods for send and receive
–  MessageListenerContainer – POJO message handler, asynchronous
•  Spring Integration support
http://www.springsource.org/spring-amqp
16
Spring-AMQP – What’s New (1.1.x)
•  Support for HA Queues
–  Broker Failover
•  Publisher Confirms
–  Callback when the message is secured in the broker
•  Publisher Returns
–  Callback if message cannot be deposited in at least one queue
•  Explicit Reply Queue
–  Avoids creation of temporary queue for request/reply scenarios
•  Dead Letter Exchange/Queue Support
17
Demo – Distributing the Spring Integration Café
Demo with AMQP
Spring Integration Café – Distributed Deployment with AMQP
19
amqp
Café OpsCafé
Storefront
http amqp
Spring Integration Café – Distributed Deployment with Hadoop
CRM Data
Marts
ERP
hdfs
map reduce
unstructured
event data
structured
information EDW
20
amqp
Café OpsCafé
Storefront
http amqp

More Related Content

What's hot

Database and Public Endpoints redundancy on Azure
Database and Public Endpoints redundancy on AzureDatabase and Public Endpoints redundancy on Azure
Database and Public Endpoints redundancy on AzureRadu Vunvulea
 
Kafka Summit SF 2017 - Running Kafka as a Service at Scale
Kafka Summit SF 2017 - Running Kafka as a Service at ScaleKafka Summit SF 2017 - Running Kafka as a Service at Scale
Kafka Summit SF 2017 - Running Kafka as a Service at Scaleconfluent
 
WebLogic Stability; Detect and Analyse Stuck Threads
WebLogic Stability; Detect and Analyse Stuck ThreadsWebLogic Stability; Detect and Analyse Stuck Threads
WebLogic Stability; Detect and Analyse Stuck ThreadsMaarten Smeets
 
Can Kafka Handle a Lyft Ride? (Andrey Falko & Can Cecen, Lyft) Kafka Summit 2020
Can Kafka Handle a Lyft Ride? (Andrey Falko & Can Cecen, Lyft) Kafka Summit 2020Can Kafka Handle a Lyft Ride? (Andrey Falko & Can Cecen, Lyft) Kafka Summit 2020
Can Kafka Handle a Lyft Ride? (Andrey Falko & Can Cecen, Lyft) Kafka Summit 2020HostedbyConfluent
 
PLNOG 13: Michał Dubiel: OpenContrail software architecture
PLNOG 13: Michał Dubiel: OpenContrail software architecturePLNOG 13: Michał Dubiel: OpenContrail software architecture
PLNOG 13: Michał Dubiel: OpenContrail software architecturePROIDEA
 
Deep Dive into Apache Kafka
Deep Dive into Apache KafkaDeep Dive into Apache Kafka
Deep Dive into Apache Kafkaconfluent
 
Troubleshooting Kafka's socket server: from incident to resolution
Troubleshooting Kafka's socket server: from incident to resolutionTroubleshooting Kafka's socket server: from incident to resolution
Troubleshooting Kafka's socket server: from incident to resolutionJoel Koshy
 
Function Mesh for Apache Pulsar, the Way for Simple Streaming Solutions
Function Mesh for Apache Pulsar, the Way for Simple Streaming SolutionsFunction Mesh for Apache Pulsar, the Way for Simple Streaming Solutions
Function Mesh for Apache Pulsar, the Way for Simple Streaming SolutionsStreamNative
 
MySQL Multi-Master Replication
MySQL Multi-Master ReplicationMySQL Multi-Master Replication
MySQL Multi-Master ReplicationMichael Naumov
 
Getting up to speed with MirrorMaker 2 | Mickael Maison, IBM and Ryanne Dolan...
Getting up to speed with MirrorMaker 2 | Mickael Maison, IBM and Ryanne Dolan...Getting up to speed with MirrorMaker 2 | Mickael Maison, IBM and Ryanne Dolan...
Getting up to speed with MirrorMaker 2 | Mickael Maison, IBM and Ryanne Dolan...HostedbyConfluent
 
Apache Kafka – (Pattern and) Anti-Pattern
Apache Kafka – (Pattern and) Anti-PatternApache Kafka – (Pattern and) Anti-Pattern
Apache Kafka – (Pattern and) Anti-Patternconfluent
 
When it Absolutely, Positively, Has to be There: Reliability Guarantees in Ka...
When it Absolutely, Positively, Has to be There: Reliability Guarantees in Ka...When it Absolutely, Positively, Has to be There: Reliability Guarantees in Ka...
When it Absolutely, Positively, Has to be There: Reliability Guarantees in Ka...confluent
 
Reliable Message Delivery with Apache Kafka
Reliable Message Delivery with Apache Kafka Reliable Message Delivery with Apache Kafka
Reliable Message Delivery with Apache Kafka confluent
 
No data loss pipeline with apache kafka
No data loss pipeline with apache kafkaNo data loss pipeline with apache kafka
No data loss pipeline with apache kafkaJiangjie Qin
 
... No it's Apache Kafka!
... No it's Apache Kafka!... No it's Apache Kafka!
... No it's Apache Kafka!makker_nl
 

What's hot (20)

Database and Public Endpoints redundancy on Azure
Database and Public Endpoints redundancy on AzureDatabase and Public Endpoints redundancy on Azure
Database and Public Endpoints redundancy on Azure
 
Kafka Summit SF 2017 - Running Kafka as a Service at Scale
Kafka Summit SF 2017 - Running Kafka as a Service at ScaleKafka Summit SF 2017 - Running Kafka as a Service at Scale
Kafka Summit SF 2017 - Running Kafka as a Service at Scale
 
WebLogic Stability; Detect and Analyse Stuck Threads
WebLogic Stability; Detect and Analyse Stuck ThreadsWebLogic Stability; Detect and Analyse Stuck Threads
WebLogic Stability; Detect and Analyse Stuck Threads
 
PostgreSQL: meet your queue
PostgreSQL: meet your queuePostgreSQL: meet your queue
PostgreSQL: meet your queue
 
Can Kafka Handle a Lyft Ride? (Andrey Falko & Can Cecen, Lyft) Kafka Summit 2020
Can Kafka Handle a Lyft Ride? (Andrey Falko & Can Cecen, Lyft) Kafka Summit 2020Can Kafka Handle a Lyft Ride? (Andrey Falko & Can Cecen, Lyft) Kafka Summit 2020
Can Kafka Handle a Lyft Ride? (Andrey Falko & Can Cecen, Lyft) Kafka Summit 2020
 
PLNOG 13: Michał Dubiel: OpenContrail software architecture
PLNOG 13: Michał Dubiel: OpenContrail software architecturePLNOG 13: Michał Dubiel: OpenContrail software architecture
PLNOG 13: Michał Dubiel: OpenContrail software architecture
 
Kafka reliability velocity 17
Kafka reliability   velocity 17Kafka reliability   velocity 17
Kafka reliability velocity 17
 
Deep Dive into Apache Kafka
Deep Dive into Apache KafkaDeep Dive into Apache Kafka
Deep Dive into Apache Kafka
 
Troubleshooting Kafka's socket server: from incident to resolution
Troubleshooting Kafka's socket server: from incident to resolutionTroubleshooting Kafka's socket server: from incident to resolution
Troubleshooting Kafka's socket server: from incident to resolution
 
Function Mesh for Apache Pulsar, the Way for Simple Streaming Solutions
Function Mesh for Apache Pulsar, the Way for Simple Streaming SolutionsFunction Mesh for Apache Pulsar, the Way for Simple Streaming Solutions
Function Mesh for Apache Pulsar, the Way for Simple Streaming Solutions
 
MySQL Multi-Master Replication
MySQL Multi-Master ReplicationMySQL Multi-Master Replication
MySQL Multi-Master Replication
 
Getting up to speed with MirrorMaker 2 | Mickael Maison, IBM and Ryanne Dolan...
Getting up to speed with MirrorMaker 2 | Mickael Maison, IBM and Ryanne Dolan...Getting up to speed with MirrorMaker 2 | Mickael Maison, IBM and Ryanne Dolan...
Getting up to speed with MirrorMaker 2 | Mickael Maison, IBM and Ryanne Dolan...
 
Apache Kafka – (Pattern and) Anti-Pattern
Apache Kafka – (Pattern and) Anti-PatternApache Kafka – (Pattern and) Anti-Pattern
Apache Kafka – (Pattern and) Anti-Pattern
 
When it Absolutely, Positively, Has to be There: Reliability Guarantees in Ka...
When it Absolutely, Positively, Has to be There: Reliability Guarantees in Ka...When it Absolutely, Positively, Has to be There: Reliability Guarantees in Ka...
When it Absolutely, Positively, Has to be There: Reliability Guarantees in Ka...
 
Reliable Message Delivery with Apache Kafka
Reliable Message Delivery with Apache Kafka Reliable Message Delivery with Apache Kafka
Reliable Message Delivery with Apache Kafka
 
No data loss pipeline with apache kafka
No data loss pipeline with apache kafkaNo data loss pipeline with apache kafka
No data loss pipeline with apache kafka
 
Galera webinar migration to galera cluster from my sql async replication
Galera webinar migration to galera cluster from my sql async replicationGalera webinar migration to galera cluster from my sql async replication
Galera webinar migration to galera cluster from my sql async replication
 
... No it's Apache Kafka!
... No it's Apache Kafka!... No it's Apache Kafka!
... No it's Apache Kafka!
 
Taking Full Advantage of Galera Multi Master Cluster
Taking Full Advantage of Galera Multi Master ClusterTaking Full Advantage of Galera Multi Master Cluster
Taking Full Advantage of Galera Multi Master Cluster
 
RabbitMQ and AMQP Model
RabbitMQ and AMQP ModelRabbitMQ and AMQP Model
RabbitMQ and AMQP Model
 

Viewers also liked

Russell 2012 introduction to spring integration and spring batch
Russell 2012   introduction to spring integration and spring batchRussell 2012   introduction to spring integration and spring batch
Russell 2012 introduction to spring integration and spring batchGaryPRussell
 
Spring Integration: from XML to Java DSL
Spring Integration: from XML to Java DSLSpring Integration: from XML to Java DSL
Spring Integration: from XML to Java DSLAndrey Krivtsun
 
Introduction to Webpack - Ordina JWorks - CC JS & Web
Introduction to Webpack - Ordina JWorks - CC JS & WebIntroduction to Webpack - Ordina JWorks - CC JS & Web
Introduction to Webpack - Ordina JWorks - CC JS & WebJWORKS powered by Ordina
 
Messaging with Spring Integration
Messaging with Spring IntegrationMessaging with Spring Integration
Messaging with Spring IntegrationVadim Mikhnevych
 
Atlanta JUG - Integrating Spring Batch and Spring Integration
Atlanta JUG - Integrating Spring Batch and Spring IntegrationAtlanta JUG - Integrating Spring Batch and Spring Integration
Atlanta JUG - Integrating Spring Batch and Spring IntegrationGunnar Hillert
 
Enterprise Integration Patterns with Spring integration!
Enterprise Integration Patterns with Spring integration!Enterprise Integration Patterns with Spring integration!
Enterprise Integration Patterns with Spring integration!hegdekiranr
 
Spring Akka Integration
Spring Akka IntegrationSpring Akka Integration
Spring Akka IntegrationJustin Park
 
Nine Neins - where Java EE will never take you
Nine Neins - where Java EE will never take youNine Neins - where Java EE will never take you
Nine Neins - where Java EE will never take youMarkus Eisele
 

Viewers also liked (12)

Russell 2012 introduction to spring integration and spring batch
Russell 2012   introduction to spring integration and spring batchRussell 2012   introduction to spring integration and spring batch
Russell 2012 introduction to spring integration and spring batch
 
Spring integration
Spring integrationSpring integration
Spring integration
 
Spring Integration: from XML to Java DSL
Spring Integration: from XML to Java DSLSpring Integration: from XML to Java DSL
Spring Integration: from XML to Java DSL
 
Introduction to Webpack - Ordina JWorks - CC JS & Web
Introduction to Webpack - Ordina JWorks - CC JS & WebIntroduction to Webpack - Ordina JWorks - CC JS & Web
Introduction to Webpack - Ordina JWorks - CC JS & Web
 
Messaging with Spring Integration
Messaging with Spring IntegrationMessaging with Spring Integration
Messaging with Spring Integration
 
Mongo db intro.pptx
Mongo db intro.pptxMongo db intro.pptx
Mongo db intro.pptx
 
Batch Processing - A&BP CC
Batch Processing - A&BP CCBatch Processing - A&BP CC
Batch Processing - A&BP CC
 
Atlanta JUG - Integrating Spring Batch and Spring Integration
Atlanta JUG - Integrating Spring Batch and Spring IntegrationAtlanta JUG - Integrating Spring Batch and Spring Integration
Atlanta JUG - Integrating Spring Batch and Spring Integration
 
Enterprise Integration Patterns with Spring integration!
Enterprise Integration Patterns with Spring integration!Enterprise Integration Patterns with Spring integration!
Enterprise Integration Patterns with Spring integration!
 
Spring Akka Integration
Spring Akka IntegrationSpring Akka Integration
Spring Akka Integration
 
Integration testing - A&BP CC
Integration testing - A&BP CCIntegration testing - A&BP CC
Integration testing - A&BP CC
 
Nine Neins - where Java EE will never take you
Nine Neins - where Java EE will never take youNine Neins - where Java EE will never take you
Nine Neins - where Java EE will never take you
 

Similar to Russell spring one2gx_messaging_india

Messaging for Modern Applications
Messaging for Modern ApplicationsMessaging for Modern Applications
Messaging for Modern ApplicationsTom McCuch
 
The Future of Messaging: RabbitMQ and AMQP
The Future of Messaging: RabbitMQ and AMQP The Future of Messaging: RabbitMQ and AMQP
The Future of Messaging: RabbitMQ and AMQP Eberhard Wolff
 
Architecture | The Future of Messaging: RabbitMQ and AMQP | Eberhard Wolff
Architecture | The Future of Messaging: RabbitMQ and AMQP | Eberhard WolffArchitecture | The Future of Messaging: RabbitMQ and AMQP | Eberhard Wolff
Architecture | The Future of Messaging: RabbitMQ and AMQP | Eberhard WolffJAX London
 
Remote core locking-Andrea Lombardo
Remote core locking-Andrea LombardoRemote core locking-Andrea Lombardo
Remote core locking-Andrea LombardoAndrea Lombardo
 
IBM IMPACT 2014 - AMC-1882 Building a Scalable & Continuously Available IBM M...
IBM IMPACT 2014 - AMC-1882 Building a Scalable & Continuously Available IBM M...IBM IMPACT 2014 - AMC-1882 Building a Scalable & Continuously Available IBM M...
IBM IMPACT 2014 - AMC-1882 Building a Scalable & Continuously Available IBM M...Peter Broadhurst
 
Enterprise Messaging With ActiveMQ and Spring JMS
Enterprise Messaging With ActiveMQ and Spring JMSEnterprise Messaging With ActiveMQ and Spring JMS
Enterprise Messaging With ActiveMQ and Spring JMSBruce Snyder
 
Messaging for modern applications
Messaging for modern applicationsMessaging for modern applications
Messaging for modern applicationsPronam Chatterjee
 
IBM MQ: Managing Workloads, Scaling and Availability with MQ Clusters
IBM MQ: Managing Workloads, Scaling and Availability with MQ ClustersIBM MQ: Managing Workloads, Scaling and Availability with MQ Clusters
IBM MQ: Managing Workloads, Scaling and Availability with MQ ClustersDavid Ware
 
Cloud computing Module 2 First Part
Cloud computing Module 2 First PartCloud computing Module 2 First Part
Cloud computing Module 2 First PartSoumee Maschatak
 
The RabbitMQ Message Broker
The RabbitMQ Message BrokerThe RabbitMQ Message Broker
The RabbitMQ Message BrokerMartin Toshev
 
Testing the limits of cloud networks
Testing the limits of cloud networksTesting the limits of cloud networks
Testing the limits of cloud networksPLUMgrid
 
Atmosphere 2016 - Pawel Mastalerz, Wojciech Inglot - New way of building inf...
Atmosphere 2016 -  Pawel Mastalerz, Wojciech Inglot - New way of building inf...Atmosphere 2016 -  Pawel Mastalerz, Wojciech Inglot - New way of building inf...
Atmosphere 2016 - Pawel Mastalerz, Wojciech Inglot - New way of building inf...PROIDEA
 
Messaging with RabbitMQ and AMQP
Messaging with RabbitMQ and AMQPMessaging with RabbitMQ and AMQP
Messaging with RabbitMQ and AMQPEberhard Wolff
 
Building scalable flexible messaging systems using qpid
Building scalable flexible messaging systems using qpidBuilding scalable flexible messaging systems using qpid
Building scalable flexible messaging systems using qpidJack Gibson
 
Xen and-the-art-of-rails-deployment2640
Xen and-the-art-of-rails-deployment2640Xen and-the-art-of-rails-deployment2640
Xen and-the-art-of-rails-deployment2640Newlink
 
Xen and-the-art-of-rails-deployment2640
Xen and-the-art-of-rails-deployment2640Xen and-the-art-of-rails-deployment2640
Xen and-the-art-of-rails-deployment2640Newlink
 
Xen and-the-art-of-rails-deployment2640
Xen and-the-art-of-rails-deployment2640Xen and-the-art-of-rails-deployment2640
Xen and-the-art-of-rails-deployment2640LLC NewLink
 
Xen and-the-art-of-rails-deployment2640
Xen and-the-art-of-rails-deployment2640Xen and-the-art-of-rails-deployment2640
Xen and-the-art-of-rails-deployment2640Newlink
 
Xen and-the-art-of-rails-deployment2640
Xen and-the-art-of-rails-deployment2640Xen and-the-art-of-rails-deployment2640
Xen and-the-art-of-rails-deployment2640Newlink
 

Similar to Russell spring one2gx_messaging_india (20)

Messaging for Modern Applications
Messaging for Modern ApplicationsMessaging for Modern Applications
Messaging for Modern Applications
 
Pg amqp
Pg amqpPg amqp
Pg amqp
 
The Future of Messaging: RabbitMQ and AMQP
The Future of Messaging: RabbitMQ and AMQP The Future of Messaging: RabbitMQ and AMQP
The Future of Messaging: RabbitMQ and AMQP
 
Architecture | The Future of Messaging: RabbitMQ and AMQP | Eberhard Wolff
Architecture | The Future of Messaging: RabbitMQ and AMQP | Eberhard WolffArchitecture | The Future of Messaging: RabbitMQ and AMQP | Eberhard Wolff
Architecture | The Future of Messaging: RabbitMQ and AMQP | Eberhard Wolff
 
Remote core locking-Andrea Lombardo
Remote core locking-Andrea LombardoRemote core locking-Andrea Lombardo
Remote core locking-Andrea Lombardo
 
IBM IMPACT 2014 - AMC-1882 Building a Scalable & Continuously Available IBM M...
IBM IMPACT 2014 - AMC-1882 Building a Scalable & Continuously Available IBM M...IBM IMPACT 2014 - AMC-1882 Building a Scalable & Continuously Available IBM M...
IBM IMPACT 2014 - AMC-1882 Building a Scalable & Continuously Available IBM M...
 
Enterprise Messaging With ActiveMQ and Spring JMS
Enterprise Messaging With ActiveMQ and Spring JMSEnterprise Messaging With ActiveMQ and Spring JMS
Enterprise Messaging With ActiveMQ and Spring JMS
 
Messaging for modern applications
Messaging for modern applicationsMessaging for modern applications
Messaging for modern applications
 
IBM MQ: Managing Workloads, Scaling and Availability with MQ Clusters
IBM MQ: Managing Workloads, Scaling and Availability with MQ ClustersIBM MQ: Managing Workloads, Scaling and Availability with MQ Clusters
IBM MQ: Managing Workloads, Scaling and Availability with MQ Clusters
 
Cloud computing Module 2 First Part
Cloud computing Module 2 First PartCloud computing Module 2 First Part
Cloud computing Module 2 First Part
 
The RabbitMQ Message Broker
The RabbitMQ Message BrokerThe RabbitMQ Message Broker
The RabbitMQ Message Broker
 
Testing the limits of cloud networks
Testing the limits of cloud networksTesting the limits of cloud networks
Testing the limits of cloud networks
 
Atmosphere 2016 - Pawel Mastalerz, Wojciech Inglot - New way of building inf...
Atmosphere 2016 -  Pawel Mastalerz, Wojciech Inglot - New way of building inf...Atmosphere 2016 -  Pawel Mastalerz, Wojciech Inglot - New way of building inf...
Atmosphere 2016 - Pawel Mastalerz, Wojciech Inglot - New way of building inf...
 
Messaging with RabbitMQ and AMQP
Messaging with RabbitMQ and AMQPMessaging with RabbitMQ and AMQP
Messaging with RabbitMQ and AMQP
 
Building scalable flexible messaging systems using qpid
Building scalable flexible messaging systems using qpidBuilding scalable flexible messaging systems using qpid
Building scalable flexible messaging systems using qpid
 
Xen and-the-art-of-rails-deployment2640
Xen and-the-art-of-rails-deployment2640Xen and-the-art-of-rails-deployment2640
Xen and-the-art-of-rails-deployment2640
 
Xen and-the-art-of-rails-deployment2640
Xen and-the-art-of-rails-deployment2640Xen and-the-art-of-rails-deployment2640
Xen and-the-art-of-rails-deployment2640
 
Xen and-the-art-of-rails-deployment2640
Xen and-the-art-of-rails-deployment2640Xen and-the-art-of-rails-deployment2640
Xen and-the-art-of-rails-deployment2640
 
Xen and-the-art-of-rails-deployment2640
Xen and-the-art-of-rails-deployment2640Xen and-the-art-of-rails-deployment2640
Xen and-the-art-of-rails-deployment2640
 
Xen and-the-art-of-rails-deployment2640
Xen and-the-art-of-rails-deployment2640Xen and-the-art-of-rails-deployment2640
Xen and-the-art-of-rails-deployment2640
 

Russell spring one2gx_messaging_india

  • 1. Addressing Messaging Challenges Using Spring and RabbitMQ © 2012 SpringOne 2GX. All rights reserved. Do not distribute without permission. Gary Russell, Staff Engineer, SpringSource; @gprussell
  • 2. Addressing Messaging Challenges •  Modern Application Trends •  Modularize with Spring Integration •  Distribute with AMQP •  Analyze with Hadoop 2
  • 3. Place Order Fulfill Order Manage Inventory Schedule Delivery If any component is unavailable within this synchronous flow, all in-flight messages will be affected, regardless of what component they are currently in -- and since state is maintained across the components, the system can be complex to reset X X X X X X X X X An exception occurred, please resend Synchronous Architecture is Brittle 3
  • 4. In this asynchronous flow: •  all state is kept in the simple messages being passed •  each stateless component interacts only with the broker cloud •  if a component is lost, only the in-flight messages within that component must be re-delivered •  components can be quickly provisioned on-demand I have an Order I can fulfill part of that Order I’ll schedule delivery of that order I can fulfill part of that OrderYour order will be delivered next Tuesday The status of your order is … Asynchronous Architecture Rules the Web 4
  • 5. Modern approaches to messaging embrace the unpredictable, dynamic, and transient nature of the web Traditional approaches to messaging imply predictable, static interaction between well- known end-points Modern Applications Need Modern Messaging 5
  • 7. •  At the core, an embedded Message Bus –  Inspired by Gregor Hohpe and Bobby Woolf's Enterprise Integration Patterns (2003) –  Runs within any Spring ApplicationContext –  All components are Spring-managed objects •  Also, an Application Integration Framework –  Connects to other systems via adapters –  Unidirectional Channel Adapters –  Bidirectional Messaging Gateways What is Spring Integration? 7
  • 9. Café http Spring Integration Café – Simple HTTP Deployment 9
  • 11. A  Protocol,  not  an  API   •  A  defined  set  of  messaging   capabili2es  called  the  AMQ   model   •  A  network  wire-­‐level   protocol,  AMQP   On  commodity  hardware   •  10-­‐25  thousand  messages   per  second  is  rou@ne  *   •  The  NIC  is  usually  the   boFleneck     *  Non-­‐persistent  messages   Why AMQP? 11
  • 12. AMQP  security   •  Brokers  support  separate   virtual  hosts   •  Three  levels  of  permissions   •  AMQP  over  SSL  is  supported   Designed  to  scale  horizontally   •  Dozens  of  clustered  brokers   are  common   Why AMQP? 12
  • 14. café NA deliveries queue café deliveries queue M3M1 M2 M3M1 M2 café WW deliveries queue M3M1 M2 AMQP Architecture 14
  • 15. hot_drinks queue cold_drinks queue 1 2 2 3 1 drink.cold Message Routing Keys: 1.  drink.hot 2.  drink.cold 3.  drink.warm all_drinks queue AMQP Architecture 15
  • 16. Spring-AMQP •  AMQP core abstraction plus RabbitMQ implementation (built on rabbit client libraries) •  Higher level patterns for clients: admin, producers and consumers –  RabbitAdmin – declare exchanges, queues, bindings –  RabbitTemplate – convenience methods for send and receive –  MessageListenerContainer – POJO message handler, asynchronous •  Spring Integration support http://www.springsource.org/spring-amqp 16
  • 17. Spring-AMQP – What’s New (1.1.x) •  Support for HA Queues –  Broker Failover •  Publisher Confirms –  Callback when the message is secured in the broker •  Publisher Returns –  Callback if message cannot be deposited in at least one queue •  Explicit Reply Queue –  Avoids creation of temporary queue for request/reply scenarios •  Dead Letter Exchange/Queue Support 17
  • 18. Demo – Distributing the Spring Integration Café Demo with AMQP
  • 19. Spring Integration Café – Distributed Deployment with AMQP 19 amqp Café OpsCafé Storefront http amqp
  • 20. Spring Integration Café – Distributed Deployment with Hadoop CRM Data Marts ERP hdfs map reduce unstructured event data structured information EDW 20 amqp Café OpsCafé Storefront http amqp