SlideShare uma empresa Scribd logo
1 de 47
Baixar para ler offline
Messaging with AMQP and
        RabbitMQ
            Eberhard Wolff
Architecture and Technology Manager
              adesso AG
Overview
•    Why Messaging, AMQP and RabbitMQ
•    Basic AMQP
•    Exchanges
•    More on Spring-AMQP
Why Messaging?
•  Decoupling
  –  Data, no action i.e. receiver
                                     Component
     can react arbitrarily
  –  Asynchronous i.e. decoupled
     by time
•  Reliable
  –  Message can be stored-and-
                                     Component
     forwarded
                                                 Messages
  –  Redelivery until message
     processed
•  Solves typical problems of
   distributed systems
Why Messaging?
•  But: Requires different architecture
•  Very different from calling remote
   methods
•  Asynchronous
•  AJAX has the same model

•  See for example “Patterns of Enterprise
   Integration”
Why AMQP?
•  Open standard protocol
•  Standard wire protocol
•  i.e. just one client library – no matter which
   implementation you are using
•  Less vendor lock in
•  Efficient
 –  Binary wire protocol
•  Support in all major languages
•  Supported on most OS platforms
What about JMS?
•  JMS has been the default for Java
   messaging system for 10+ years
•  But:
  –  Only standardized on the API level
  –  Less flexible than AMQP
•  Mapping AMQP/JMS is being defined
•  Some products support both
Why Rabbit?
•    Because it has a kewl name
•    Numerous protocols supported
•    Most popular choice on EC2
•    Foundation for demanding systems e.g.
     NASA’s cloud initiative Nebula
•    Implemented in Erlang
•    Clustering built in
•    Currently in 2.8.7
•    Supports AMQP 0.8, 0.9, 0.9.1
•    1.0 as a prototype Plug In
Broad Support in RabbitMQ
Broad Support in the JVM Space
•  Grails Plug In
•  Java Client
•  Scala / Lift support

•  We will discuss Spring support in detail
•  Spring AMQP project 1.1.2
•  http://www.springsource.org/spring-
   amqp
Why Erlang?
•  Originally designed for telephone
   switches by Ericsson
•  Much easier to develop scalable and fault
   tolerant systems
   (by factors)
•  See Motorola presentation:
   http://www.slideshare.net/Arbow/comparing-
   cpp-and-erlang-for-motorola-telecoms-software
•  Good tool for reliable and scalable systems
Erlang‘s Model
                      Monitor
Link to monitor,
restart



  Light               Light                 Light
  weight    Messages weight     Messages    weight
 process             process               process
   with                with                  with
   state               state                 state
Why Erlang?
•  Let it crash
  –  If a process fails, it can be easily restarted
  –  Different approach to fault tolerance
  –  Otherwise lots of error handling
•  Message Passing in the Core
  –  RabbitMQ is a messaging system…
•  Light-weight process model
  –  Scales to massive numbers of connections
Basic AMQP
Very Basic AMQP
•  Queues: Store messages
•  Queues might be
  –  Durable: Survive server restarts
  –  Exclusive: For one connection
  –  autoDelete: Deleted if connection closes
•  All resources are dynamic
•  Producer sends a message to a Queue
Code
ConnectionFactory conFactory =	
   new CachingConnectionFactory ("localhost");	
RabbitAdmin admin = new RabbitAdmin(conFactory);	
admin.declareQueue(

  new Queue("myQueue", false, true, true));	
	
	
RabbitTemplate template = 	
  new RabbitTemplate(conFactory);	
template.convertAndSend("myQueue", "Hi AMQP!");	
String receive =	
  (String) template.receiveAndConvert("myQueue");	
Assert.assertEquals("Hi AMQP!", receive);
Spring’s MessageConverter
•  Messages are binary data
•  RabbitTemplate uses
   MessageConverter
   to convert between objects and
   messages
•  E.g. JSON, Serialization, XML …
•  Can also send binary data if preferred
Basics of AMQP
•  Sending messages directly to queues is
   not enough
•  What about e.g. pub / sub?

•  Exchange: Route messages (stateless)
•  Example used the default exchange

•  More dynamic, flexible and cleaner than
   JMS
AMQP	
  in	
  a	
  nutshell	
  
Exchange routes message
Stateless
Usually created by producer
No queue: Message discarded
           X

               Binding binds an
               Exchange to a Queue    Queues buffer
                                      messages
                                      Usually created by
                                      consumer
AMQP	
  in	
  a	
  nutshell	
  
Producer and Consumer might be written in Java, C#,
Python, Ruby …

                                                      C
        P          X

                                                      C


        AMQP             RabbitMQ               AMQP
        protocol                                protocol
Exchanges
X

 Exchange: Route Messages
•  The type of Exchange defines the
   routing algorithm
•  Binding provides selector for routing
•  Exchange is addressed by name

•  Some standard types
•  Can provide additional ones
X

        Fanout Exchange
•  Broadcast to all bound queues
•  Fast
•  Simple

•  amq.fanout is mandatory

•  To broadcast information
X

    Fanout Exchange
                      C
P     X

                      C
    Fanout
                      C
Queue fanoutQueue = new Queue("fanoutQueue");	
admin.declareQueue(fanoutQueue);	
	
FanoutExchange fanoutExchange=	
  new FanoutExchange("myFanout");	
admin.declareExchange(fanoutExchange);	
	
admin.declareBinding(	
  BindingBuilder.bind(fanoutQueue).	
                 to(fanoutExchange));	
	
template.setExchange("myFanout");	
template.convertAndSend("Hi Fanout!");	
String receive = (String)	
   template.receiveAndConvert("fanoutQueue");	
Assert.assertEquals("Hi Fanout!", receive);
X
            Direct Exchange
•  Routing based on one routing key
•  amq.direct and the default Exchange (no
   name) always exist

•  To send work orders to a specific worker
Direct Exchange
normal
express
          Direct
          Exchange                 C
                     express
   P         X

                                   C
                 normal
                                   C
X
             Topic Exchange
•  Routing based on routing pattern
•  amq.topic is mandatory

•  E.g. for public / subscribe scenarios
Topic Exchange	
  
 order.DE
invoice.USD
         Topic
         Exchange
                    order.*
    P      X                         C


               invoice.*
                                     C
X
          Headers Exchange
•  Routing based on one or more headers and
   an expression
•  amqp.match is mandatory

•  Complex routing roles
Other Features
•  Message can be persistent
•  Request / response using correlations
   possible

•  Redelivery / acknowledgement possible

•  Clustering with e.g. Linux HA possible
•  ...or send message through multiple
   channels and drop duplicates
More on Spring AMQP
The MessageListener
•  So far: Calling receive() on
   RabbitTemplate
•  Needed: Something that is called when
   a new message appears
Spring’s MessageListener
            Container
•  Spring provides lightweight containers
   to call MessageListeners
•  SimpleMessageListenerContainer
•  Advanced scheduling and endpoint
   management options available
•  i.e. thread pools, concurrent consumers,
   transaction handling
Spring's message-driven objects
•  MessageListener means the receiver
   depends on Spring API
•  Why not just a POJO?
Message-driven POJO
<rabbit:listener-container
 connection-factory="connectionFactory“
 message-converter="jsonMessageConverter">
    <rabbit:listener ref="consumer" method="consume"
                     queue-names="my.amqp.queue2" />
</rabbit:listener-container>

•  Takes a POJO and makes it a
   MessageListener
•  i.e. calls consume on Bean consume
@Component	  Consumer code
public class Consumer {	
	
  public String consume(String message) {	
     return …;	
  }	
}
•  No dependency on AMQP!
•  But: What about the result of the method?
•  Send to the Reply-To address given in
   message properties with same correlationId
   as original method
Client Code
String response = (String) 	
  rabbitTemplate.convertSendAndReceive(	
    "my.fanout", "", "test");
•  Message sent to destination with routing key
•  Reply-To set to exclusive, autodelete, non-
   durable queue
•  Response received through Reply-To
   converted and returned
•  Easy request-response!
•  Beware of potential latency
Web Messaging
Web Messaging
•  Goal: Send / receive messages in the
   browser
•  With JavaScript
•  I.e. JavaScript must receive message
•  HTML5 browser: WebSockets
•  Pre HTML5: long polling etc
SockJS
•  Unifies Web Sockets, long polling etc
•  Unified JavaScript API

•  Server component
•  Can run embedded in RabbitMQ
STOMP
•  Simple (or Streaming) Text Oriented
   Message Protocol
•  Very simple protocol for Message Oriented
   Middleware

•  STOMP over SockJS
•  See http://www.rabbitmq.com/blog/
   2012/05/14/introducing-rabbitmq-web-
   stomp/
STOMP
JavaScript                                       Java
               SockJS                     AMQP    C#
             Web Sockets                          …
             Long Polling


                     http://127.0.0.1:55670/
JavaScript Code
WebSocketStompMock = SockJS;
var client =
 Stomp.client('http://localhost:55674/stomp');
…
client.send('/topic/test', {}, data);
…
client.connect('guest', 'guest', function(x) {
   id = client.subscribe("/topic/test", function(message) {
        if (message.body) {
         alert("got message with body " + message.body)
       }                          AMQP: Topic exchange
  });                             amq.topic
});                               with routing key test
Conclusion: AMQP
•    Ubiquitous Messaging
•    AMQP: Protocol standard
•    Better scalability
•    Dynamic resources
Conclusion: Spring AMQP
•    Easy to use
•    Flexible (e.g. message encoding)
•    Allows scalable message handling
•    Full support for AMQP and RabbitMQ
Conclusion: Web Messaging
•    Simple API
•    Works on older browsers
•    Single server – also for messaging
•    Erlang is very well able to handle the
     many connections
More
•  http://springsource.org/spring-amqp
•  Also a .NET version available
•  …and support in Spring Integration
•  …and there is very similar Spring JMS support
•  http://blog.springsource.com/2011/04/01/routing-
   topologies-for-performance-and-scalability-with-
   rabbitm
•  https://github.com/zanox/rabbiteasy
     –  CDI event / AMQP integration
     –  Managed publisher and consumer

Mais conteúdo relacionado

Mais procurados

Introduction To RabbitMQ
Introduction To RabbitMQIntroduction To RabbitMQ
Introduction To RabbitMQKnoldus Inc.
 
IBM MQ: An Introduction to Using and Developing with MQ Publish/Subscribe
IBM MQ: An Introduction to Using and Developing with MQ Publish/SubscribeIBM MQ: An Introduction to Using and Developing with MQ Publish/Subscribe
IBM MQ: An Introduction to Using and Developing with MQ Publish/SubscribeDavid Ware
 
Dissecting the rabbit: RabbitMQ Internal Architecture
Dissecting the rabbit: RabbitMQ Internal ArchitectureDissecting the rabbit: RabbitMQ Internal Architecture
Dissecting the rabbit: RabbitMQ Internal ArchitectureAlvaro Videla
 
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
 
RabbitMQ and AMQP with .net client library
RabbitMQ and AMQP with .net client libraryRabbitMQ and AMQP with .net client library
RabbitMQ and AMQP with .net client libraryMohammed Shaban
 
[@NaukriEngineering] Messaging Queues
[@NaukriEngineering] Messaging Queues[@NaukriEngineering] Messaging Queues
[@NaukriEngineering] Messaging QueuesNaukri.com
 
Apache Kafka - Martin Podval
Apache Kafka - Martin PodvalApache Kafka - Martin Podval
Apache Kafka - Martin PodvalMartin Podval
 
M2M Protocols for Constrained Environments in the Context of IoT: A Compariso...
M2M Protocols for Constrained Environments in the Context of IoT: A Compariso...M2M Protocols for Constrained Environments in the Context of IoT: A Compariso...
M2M Protocols for Constrained Environments in the Context of IoT: A Compariso...Edielson P. Frigieri
 
What we've learned from running thousands of production RabbitMQ clusters - L...
What we've learned from running thousands of production RabbitMQ clusters - L...What we've learned from running thousands of production RabbitMQ clusters - L...
What we've learned from running thousands of production RabbitMQ clusters - L...RabbitMQ Summit
 
IBM MQ and Kafka, what is the difference?
IBM MQ and Kafka, what is the difference?IBM MQ and Kafka, what is the difference?
IBM MQ and Kafka, what is the difference?David Ware
 
Introduction to Apache ActiveMQ Artemis
Introduction to Apache ActiveMQ ArtemisIntroduction to Apache ActiveMQ Artemis
Introduction to Apache ActiveMQ ArtemisYoshimasa Tanabe
 
RabbitMQ Data Ingestion
RabbitMQ Data IngestionRabbitMQ Data Ingestion
RabbitMQ Data IngestionAlvaro Videla
 
IBM MQ - What's new in 9.2
IBM MQ - What's new in 9.2IBM MQ - What's new in 9.2
IBM MQ - What's new in 9.2David Ware
 

Mais procurados (20)

RabbitMQ
RabbitMQRabbitMQ
RabbitMQ
 
Introduction To RabbitMQ
Introduction To RabbitMQIntroduction To RabbitMQ
Introduction To RabbitMQ
 
RabbitMQ
RabbitMQ RabbitMQ
RabbitMQ
 
Message Broker System and RabbitMQ
Message Broker System and RabbitMQMessage Broker System and RabbitMQ
Message Broker System and RabbitMQ
 
AMQP
AMQPAMQP
AMQP
 
IBM MQ: An Introduction to Using and Developing with MQ Publish/Subscribe
IBM MQ: An Introduction to Using and Developing with MQ Publish/SubscribeIBM MQ: An Introduction to Using and Developing with MQ Publish/Subscribe
IBM MQ: An Introduction to Using and Developing with MQ Publish/Subscribe
 
RabbitMQ Operations
RabbitMQ OperationsRabbitMQ Operations
RabbitMQ Operations
 
Dissecting the rabbit: RabbitMQ Internal Architecture
Dissecting the rabbit: RabbitMQ Internal ArchitectureDissecting the rabbit: RabbitMQ Internal Architecture
Dissecting the rabbit: RabbitMQ Internal Architecture
 
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
 
RabbitMQ and AMQP with .net client library
RabbitMQ and AMQP with .net client libraryRabbitMQ and AMQP with .net client library
RabbitMQ and AMQP with .net client library
 
Overview of Message Queues
Overview of Message QueuesOverview of Message Queues
Overview of Message Queues
 
[@NaukriEngineering] Messaging Queues
[@NaukriEngineering] Messaging Queues[@NaukriEngineering] Messaging Queues
[@NaukriEngineering] Messaging Queues
 
Apache Kafka - Martin Podval
Apache Kafka - Martin PodvalApache Kafka - Martin Podval
Apache Kafka - Martin Podval
 
M2M Protocols for Constrained Environments in the Context of IoT: A Compariso...
M2M Protocols for Constrained Environments in the Context of IoT: A Compariso...M2M Protocols for Constrained Environments in the Context of IoT: A Compariso...
M2M Protocols for Constrained Environments in the Context of IoT: A Compariso...
 
What we've learned from running thousands of production RabbitMQ clusters - L...
What we've learned from running thousands of production RabbitMQ clusters - L...What we've learned from running thousands of production RabbitMQ clusters - L...
What we've learned from running thousands of production RabbitMQ clusters - L...
 
RabbitMQ & Kafka
RabbitMQ & KafkaRabbitMQ & Kafka
RabbitMQ & Kafka
 
IBM MQ and Kafka, what is the difference?
IBM MQ and Kafka, what is the difference?IBM MQ and Kafka, what is the difference?
IBM MQ and Kafka, what is the difference?
 
Introduction to Apache ActiveMQ Artemis
Introduction to Apache ActiveMQ ArtemisIntroduction to Apache ActiveMQ Artemis
Introduction to Apache ActiveMQ Artemis
 
RabbitMQ Data Ingestion
RabbitMQ Data IngestionRabbitMQ Data Ingestion
RabbitMQ Data Ingestion
 
IBM MQ - What's new in 9.2
IBM MQ - What's new in 9.2IBM MQ - What's new in 9.2
IBM MQ - What's new in 9.2
 

Destaque

Full Stack Bus with Javascript, RabbitMQ and Postal.js
Full Stack Bus with Javascript, RabbitMQ and Postal.jsFull Stack Bus with Javascript, RabbitMQ and Postal.js
Full Stack Bus with Javascript, RabbitMQ and Postal.jsJavier Arias Losada
 
Microservice vs. Monolithic Architecture
Microservice vs. Monolithic ArchitectureMicroservice vs. Monolithic Architecture
Microservice vs. Monolithic ArchitecturePaul Mooney
 
RabbitMQ 101 : How to cook the rabbit? - phptour 2016
RabbitMQ 101 : How to cook the rabbit? - phptour 2016RabbitMQ 101 : How to cook the rabbit? - phptour 2016
RabbitMQ 101 : How to cook the rabbit? - phptour 2016Quentin Adam
 
Troubleshooting RabbitMQ and Microservices That Use It
Troubleshooting RabbitMQ and Microservices That Use ItTroubleshooting RabbitMQ and Microservices That Use It
Troubleshooting RabbitMQ and Microservices That Use ItVMware Tanzu
 
Beginning Microservices with .NET & RabbitMQ
Beginning Microservices with .NET & RabbitMQBeginning Microservices with .NET & RabbitMQ
Beginning Microservices with .NET & RabbitMQPaul Mooney
 
Introduction to ZeroMQ - eSpace TechTalk
Introduction to ZeroMQ - eSpace TechTalkIntroduction to ZeroMQ - eSpace TechTalk
Introduction to ZeroMQ - eSpace TechTalkMahmoud Said
 
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
 
Microservice-based Architecture on the Salesforce App Cloud
Microservice-based Architecture on the Salesforce App CloudMicroservice-based Architecture on the Salesforce App Cloud
Microservice-based Architecture on the Salesforce App Cloudpbattisson
 
Refactoring to Java 8 (Devoxx BE)
Refactoring to Java 8 (Devoxx BE)Refactoring to Java 8 (Devoxx BE)
Refactoring to Java 8 (Devoxx BE)Trisha Gee
 
High powered messaging with RabbitMQ
High powered messaging with RabbitMQHigh powered messaging with RabbitMQ
High powered messaging with RabbitMQJames Carr
 
REST vs. Messaging For Microservices
REST vs. Messaging For MicroservicesREST vs. Messaging For Microservices
REST vs. Messaging For MicroservicesEberhard Wolff
 
45916215 quimica-ejercicios-resueltos-soluciones-2º-bachillerato-equilibrio-q...
45916215 quimica-ejercicios-resueltos-soluciones-2º-bachillerato-equilibrio-q...45916215 quimica-ejercicios-resueltos-soluciones-2º-bachillerato-equilibrio-q...
45916215 quimica-ejercicios-resueltos-soluciones-2º-bachillerato-equilibrio-q...María Victoria Arques Galiana
 
Quimica para todos - La enseñanza de la química al alcance de todos
Quimica para todos - La enseñanza de la química al alcance de todosQuimica para todos - La enseñanza de la química al alcance de todos
Quimica para todos - La enseñanza de la química al alcance de todosmniebuhr
 
Las reacciones químicas y la estequiometría en general
Las reacciones químicas y la estequiometría en generalLas reacciones químicas y la estequiometría en general
Las reacciones químicas y la estequiometría en generalcbtis 71 dgeti sems sep
 

Destaque (20)

AMQP 1.0 introduction
AMQP 1.0 introductionAMQP 1.0 introduction
AMQP 1.0 introduction
 
Full Stack Bus with Javascript, RabbitMQ and Postal.js
Full Stack Bus with Javascript, RabbitMQ and Postal.jsFull Stack Bus with Javascript, RabbitMQ and Postal.js
Full Stack Bus with Javascript, RabbitMQ and Postal.js
 
Microservice vs. Monolithic Architecture
Microservice vs. Monolithic ArchitectureMicroservice vs. Monolithic Architecture
Microservice vs. Monolithic Architecture
 
RabbitMQ 101 : How to cook the rabbit? - phptour 2016
RabbitMQ 101 : How to cook the rabbit? - phptour 2016RabbitMQ 101 : How to cook the rabbit? - phptour 2016
RabbitMQ 101 : How to cook the rabbit? - phptour 2016
 
Рецепты RabbitMQ
Рецепты RabbitMQ Рецепты RabbitMQ
Рецепты RabbitMQ
 
Troubleshooting RabbitMQ and Microservices That Use It
Troubleshooting RabbitMQ and Microservices That Use ItTroubleshooting RabbitMQ and Microservices That Use It
Troubleshooting RabbitMQ and Microservices That Use It
 
Beginning Microservices with .NET & RabbitMQ
Beginning Microservices with .NET & RabbitMQBeginning Microservices with .NET & RabbitMQ
Beginning Microservices with .NET & RabbitMQ
 
Introduction to ZeroMQ - eSpace TechTalk
Introduction to ZeroMQ - eSpace TechTalkIntroduction to ZeroMQ - eSpace TechTalk
Introduction to ZeroMQ - eSpace TechTalk
 
Spring AMQP × RabbitMQ
Spring AMQP × RabbitMQSpring AMQP × RabbitMQ
Spring AMQP × RabbitMQ
 
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
 
Spring RabbitMQ
Spring RabbitMQSpring RabbitMQ
Spring RabbitMQ
 
Microservice-based Architecture on the Salesforce App Cloud
Microservice-based Architecture on the Salesforce App CloudMicroservice-based Architecture on the Salesforce App Cloud
Microservice-based Architecture on the Salesforce App Cloud
 
Spring 4 Web App
Spring 4 Web AppSpring 4 Web App
Spring 4 Web App
 
Refactoring to Java 8 (Devoxx BE)
Refactoring to Java 8 (Devoxx BE)Refactoring to Java 8 (Devoxx BE)
Refactoring to Java 8 (Devoxx BE)
 
High powered messaging with RabbitMQ
High powered messaging with RabbitMQHigh powered messaging with RabbitMQ
High powered messaging with RabbitMQ
 
REST vs. Messaging For Microservices
REST vs. Messaging For MicroservicesREST vs. Messaging For Microservices
REST vs. Messaging For Microservices
 
45916215 quimica-ejercicios-resueltos-soluciones-2º-bachillerato-equilibrio-q...
45916215 quimica-ejercicios-resueltos-soluciones-2º-bachillerato-equilibrio-q...45916215 quimica-ejercicios-resueltos-soluciones-2º-bachillerato-equilibrio-q...
45916215 quimica-ejercicios-resueltos-soluciones-2º-bachillerato-equilibrio-q...
 
Microservices e RabbitMQ
Microservices e RabbitMQMicroservices e RabbitMQ
Microservices e RabbitMQ
 
Quimica para todos - La enseñanza de la química al alcance de todos
Quimica para todos - La enseñanza de la química al alcance de todosQuimica para todos - La enseñanza de la química al alcance de todos
Quimica para todos - La enseñanza de la química al alcance de todos
 
Las reacciones químicas y la estequiometría en general
Las reacciones químicas y la estequiometría en generalLas reacciones químicas y la estequiometría en general
Las reacciones químicas y la estequiometría en general
 

Semelhante a Messaging with RabbitMQ and AMQP

Построение распределенной системы сбора данных с помощью RabbitMQ, Alvaro Vid...
Построение распределенной системы сбора данных с помощью RabbitMQ, Alvaro Vid...Построение распределенной системы сбора данных с помощью RabbitMQ, Alvaro Vid...
Построение распределенной системы сбора данных с помощью RabbitMQ, Alvaro Vid...Ontico
 
CBDW2014 - Down the RabbitMQ hole with ColdFusion
CBDW2014 - Down the RabbitMQ hole with ColdFusionCBDW2014 - Down the RabbitMQ hole with ColdFusion
CBDW2014 - Down the RabbitMQ hole with ColdFusionOrtus Solutions, Corp
 
Enterprise Messaging with RabbitMQ.pdf
Enterprise Messaging with RabbitMQ.pdfEnterprise Messaging with RabbitMQ.pdf
Enterprise Messaging with RabbitMQ.pdfOrtus Solutions, Corp
 
Multiply like rabbits with rabbit mq
Multiply like rabbits with rabbit mqMultiply like rabbits with rabbit mq
Multiply like rabbits with rabbit mqdevObjective
 
Multiply like rabbits with rabbit mq
Multiply like rabbits with rabbit mqMultiply like rabbits with rabbit mq
Multiply like rabbits with rabbit mqColdFusionConference
 
Real time system_performance_mon
Real time system_performance_monReal time system_performance_mon
Real time system_performance_monTomas Doran
 
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
 
Integrating PostgreSql with RabbitMQ
Integrating PostgreSql with RabbitMQIntegrating PostgreSql with RabbitMQ
Integrating PostgreSql with RabbitMQGavin Roy
 
Ruby Microservices with RabbitMQ
Ruby Microservices with RabbitMQRuby Microservices with RabbitMQ
Ruby Microservices with RabbitMQZoran Majstorovic
 
Life in a Queue - Using Message Queue with django
Life in a Queue - Using Message Queue with djangoLife in a Queue - Using Message Queue with django
Life in a Queue - Using Message Queue with djangoTareque Hossain
 
Messaging Standards and Systems - AMQP & RabbitMQ
Messaging Standards and Systems - AMQP & RabbitMQMessaging Standards and Systems - AMQP & RabbitMQ
Messaging Standards and Systems - AMQP & RabbitMQPOSSCON
 
Messaging Standards and Systems - AMQP & RabbitMQ
Messaging Standards and Systems - AMQP & RabbitMQMessaging Standards and Systems - AMQP & RabbitMQ
Messaging Standards and Systems - AMQP & RabbitMQAll Things Open
 

Semelhante a Messaging with RabbitMQ and AMQP (20)

Follow the White Rabbit - Message Queues with PHP
Follow the White Rabbit - Message Queues with PHPFollow the White Rabbit - Message Queues with PHP
Follow the White Rabbit - Message Queues with PHP
 
Построение распределенной системы сбора данных с помощью RabbitMQ, Alvaro Vid...
Построение распределенной системы сбора данных с помощью RabbitMQ, Alvaro Vid...Построение распределенной системы сбора данных с помощью RabbitMQ, Alvaro Vid...
Построение распределенной системы сбора данных с помощью RabbitMQ, Alvaro Vid...
 
CBDW2014 - Down the RabbitMQ hole with ColdFusion
CBDW2014 - Down the RabbitMQ hole with ColdFusionCBDW2014 - Down the RabbitMQ hole with ColdFusion
CBDW2014 - Down the RabbitMQ hole with ColdFusion
 
RabbitMQ and AMQP Model
RabbitMQ and AMQP ModelRabbitMQ and AMQP Model
RabbitMQ and AMQP Model
 
Enterprise messaging
Enterprise messagingEnterprise messaging
Enterprise messaging
 
Spring RabbitMQ
Spring RabbitMQSpring RabbitMQ
Spring RabbitMQ
 
Enterprise Messaging with RabbitMQ.pdf
Enterprise Messaging with RabbitMQ.pdfEnterprise Messaging with RabbitMQ.pdf
Enterprise Messaging with RabbitMQ.pdf
 
Multiply like rabbits with rabbit mq
Multiply like rabbits with rabbit mqMultiply like rabbits with rabbit mq
Multiply like rabbits with rabbit mq
 
Multiply like rabbits with rabbit mq
Multiply like rabbits with rabbit mqMultiply like rabbits with rabbit mq
Multiply like rabbits with rabbit mq
 
Real time system_performance_mon
Real time system_performance_monReal time system_performance_mon
Real time system_performance_mon
 
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
 
Integrating PostgreSql with RabbitMQ
Integrating PostgreSql with RabbitMQIntegrating PostgreSql with RabbitMQ
Integrating PostgreSql with RabbitMQ
 
zeromq
zeromqzeromq
zeromq
 
MPI n OpenMP
MPI n OpenMPMPI n OpenMP
MPI n OpenMP
 
Spring integration
Spring integrationSpring integration
Spring integration
 
Ruby Microservices with RabbitMQ
Ruby Microservices with RabbitMQRuby Microservices with RabbitMQ
Ruby Microservices with RabbitMQ
 
Rabbit MQ
Rabbit MQRabbit MQ
Rabbit MQ
 
Life in a Queue - Using Message Queue with django
Life in a Queue - Using Message Queue with djangoLife in a Queue - Using Message Queue with django
Life in a Queue - Using Message Queue with django
 
Messaging Standards and Systems - AMQP & RabbitMQ
Messaging Standards and Systems - AMQP & RabbitMQMessaging Standards and Systems - AMQP & RabbitMQ
Messaging Standards and Systems - AMQP & RabbitMQ
 
Messaging Standards and Systems - AMQP & RabbitMQ
Messaging Standards and Systems - AMQP & RabbitMQMessaging Standards and Systems - AMQP & RabbitMQ
Messaging Standards and Systems - AMQP & RabbitMQ
 

Mais de Eberhard Wolff

Architectures and Alternatives
Architectures and AlternativesArchitectures and Alternatives
Architectures and AlternativesEberhard Wolff
 
The Frontiers of Continuous Delivery
The Frontiers of Continuous DeliveryThe Frontiers of Continuous Delivery
The Frontiers of Continuous DeliveryEberhard Wolff
 
Four Times Microservices - REST, Kubernetes, UI Integration, Async
Four Times Microservices - REST, Kubernetes, UI Integration, AsyncFour Times Microservices - REST, Kubernetes, UI Integration, Async
Four Times Microservices - REST, Kubernetes, UI Integration, AsyncEberhard Wolff
 
Microservices - not just with Java
Microservices - not just with JavaMicroservices - not just with Java
Microservices - not just with JavaEberhard Wolff
 
Deployment - Done Right!
Deployment - Done Right!Deployment - Done Right!
Deployment - Done Right!Eberhard Wolff
 
Data Architecture not Just for Microservices
Data Architecture not Just for MicroservicesData Architecture not Just for Microservices
Data Architecture not Just for MicroservicesEberhard Wolff
 
How to Split Your System into Microservices
How to Split Your System into MicroservicesHow to Split Your System into Microservices
How to Split Your System into MicroservicesEberhard Wolff
 
Microservices and Self-contained System to Scale Agile
Microservices and Self-contained System to Scale AgileMicroservices and Self-contained System to Scale Agile
Microservices and Self-contained System to Scale AgileEberhard Wolff
 
How Small Can Java Microservices Be?
How Small Can Java Microservices Be?How Small Can Java Microservices Be?
How Small Can Java Microservices Be?Eberhard Wolff
 
Data Architecturen Not Just for Microservices
Data Architecturen Not Just for MicroservicesData Architecturen Not Just for Microservices
Data Architecturen Not Just for MicroservicesEberhard Wolff
 
Microservices: Redundancy=Maintainability
Microservices: Redundancy=MaintainabilityMicroservices: Redundancy=Maintainability
Microservices: Redundancy=MaintainabilityEberhard Wolff
 
Self-contained Systems: A Different Approach to Microservices
Self-contained Systems: A Different Approach to MicroservicesSelf-contained Systems: A Different Approach to Microservices
Self-contained Systems: A Different Approach to MicroservicesEberhard Wolff
 
Microservices Technology Stack
Microservices Technology StackMicroservices Technology Stack
Microservices Technology StackEberhard Wolff
 
Software Architecture for Innovation
Software Architecture for InnovationSoftware Architecture for Innovation
Software Architecture for InnovationEberhard Wolff
 
Five (easy?) Steps Towards Continuous Delivery
Five (easy?) Steps Towards Continuous DeliveryFive (easy?) Steps Towards Continuous Delivery
Five (easy?) Steps Towards Continuous DeliveryEberhard Wolff
 
Nanoservices and Microservices with Java
Nanoservices and Microservices with JavaNanoservices and Microservices with Java
Nanoservices and Microservices with JavaEberhard Wolff
 
Microservices: Architecture to Support Agile
Microservices: Architecture to Support AgileMicroservices: Architecture to Support Agile
Microservices: Architecture to Support AgileEberhard Wolff
 
Microservices: Architecture to scale Agile
Microservices: Architecture to scale AgileMicroservices: Architecture to scale Agile
Microservices: Architecture to scale AgileEberhard Wolff
 
Microservices, DevOps, Continuous Delivery – More Than Three Buzzwords
Microservices, DevOps, Continuous Delivery – More Than Three BuzzwordsMicroservices, DevOps, Continuous Delivery – More Than Three Buzzwords
Microservices, DevOps, Continuous Delivery – More Than Three BuzzwordsEberhard Wolff
 

Mais de Eberhard Wolff (20)

Architectures and Alternatives
Architectures and AlternativesArchitectures and Alternatives
Architectures and Alternatives
 
Beyond Microservices
Beyond MicroservicesBeyond Microservices
Beyond Microservices
 
The Frontiers of Continuous Delivery
The Frontiers of Continuous DeliveryThe Frontiers of Continuous Delivery
The Frontiers of Continuous Delivery
 
Four Times Microservices - REST, Kubernetes, UI Integration, Async
Four Times Microservices - REST, Kubernetes, UI Integration, AsyncFour Times Microservices - REST, Kubernetes, UI Integration, Async
Four Times Microservices - REST, Kubernetes, UI Integration, Async
 
Microservices - not just with Java
Microservices - not just with JavaMicroservices - not just with Java
Microservices - not just with Java
 
Deployment - Done Right!
Deployment - Done Right!Deployment - Done Right!
Deployment - Done Right!
 
Data Architecture not Just for Microservices
Data Architecture not Just for MicroservicesData Architecture not Just for Microservices
Data Architecture not Just for Microservices
 
How to Split Your System into Microservices
How to Split Your System into MicroservicesHow to Split Your System into Microservices
How to Split Your System into Microservices
 
Microservices and Self-contained System to Scale Agile
Microservices and Self-contained System to Scale AgileMicroservices and Self-contained System to Scale Agile
Microservices and Self-contained System to Scale Agile
 
How Small Can Java Microservices Be?
How Small Can Java Microservices Be?How Small Can Java Microservices Be?
How Small Can Java Microservices Be?
 
Data Architecturen Not Just for Microservices
Data Architecturen Not Just for MicroservicesData Architecturen Not Just for Microservices
Data Architecturen Not Just for Microservices
 
Microservices: Redundancy=Maintainability
Microservices: Redundancy=MaintainabilityMicroservices: Redundancy=Maintainability
Microservices: Redundancy=Maintainability
 
Self-contained Systems: A Different Approach to Microservices
Self-contained Systems: A Different Approach to MicroservicesSelf-contained Systems: A Different Approach to Microservices
Self-contained Systems: A Different Approach to Microservices
 
Microservices Technology Stack
Microservices Technology StackMicroservices Technology Stack
Microservices Technology Stack
 
Software Architecture for Innovation
Software Architecture for InnovationSoftware Architecture for Innovation
Software Architecture for Innovation
 
Five (easy?) Steps Towards Continuous Delivery
Five (easy?) Steps Towards Continuous DeliveryFive (easy?) Steps Towards Continuous Delivery
Five (easy?) Steps Towards Continuous Delivery
 
Nanoservices and Microservices with Java
Nanoservices and Microservices with JavaNanoservices and Microservices with Java
Nanoservices and Microservices with Java
 
Microservices: Architecture to Support Agile
Microservices: Architecture to Support AgileMicroservices: Architecture to Support Agile
Microservices: Architecture to Support Agile
 
Microservices: Architecture to scale Agile
Microservices: Architecture to scale AgileMicroservices: Architecture to scale Agile
Microservices: Architecture to scale Agile
 
Microservices, DevOps, Continuous Delivery – More Than Three Buzzwords
Microservices, DevOps, Continuous Delivery – More Than Three BuzzwordsMicroservices, DevOps, Continuous Delivery – More Than Three Buzzwords
Microservices, DevOps, Continuous Delivery – More Than Three Buzzwords
 

Último

08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
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
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 

Último (20)

08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
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
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 

Messaging with RabbitMQ and AMQP

  • 1. Messaging with AMQP and RabbitMQ Eberhard Wolff Architecture and Technology Manager adesso AG
  • 2. Overview •  Why Messaging, AMQP and RabbitMQ •  Basic AMQP •  Exchanges •  More on Spring-AMQP
  • 3. Why Messaging? •  Decoupling –  Data, no action i.e. receiver Component can react arbitrarily –  Asynchronous i.e. decoupled by time •  Reliable –  Message can be stored-and- Component forwarded Messages –  Redelivery until message processed •  Solves typical problems of distributed systems
  • 4. Why Messaging? •  But: Requires different architecture •  Very different from calling remote methods •  Asynchronous •  AJAX has the same model •  See for example “Patterns of Enterprise Integration”
  • 5. Why AMQP? •  Open standard protocol •  Standard wire protocol •  i.e. just one client library – no matter which implementation you are using •  Less vendor lock in •  Efficient –  Binary wire protocol •  Support in all major languages •  Supported on most OS platforms
  • 6. What about JMS? •  JMS has been the default for Java messaging system for 10+ years •  But: –  Only standardized on the API level –  Less flexible than AMQP •  Mapping AMQP/JMS is being defined •  Some products support both
  • 7. Why Rabbit? •  Because it has a kewl name •  Numerous protocols supported •  Most popular choice on EC2 •  Foundation for demanding systems e.g. NASA’s cloud initiative Nebula •  Implemented in Erlang •  Clustering built in •  Currently in 2.8.7 •  Supports AMQP 0.8, 0.9, 0.9.1 •  1.0 as a prototype Plug In
  • 8. Broad Support in RabbitMQ
  • 9. Broad Support in the JVM Space •  Grails Plug In •  Java Client •  Scala / Lift support •  We will discuss Spring support in detail •  Spring AMQP project 1.1.2 •  http://www.springsource.org/spring- amqp
  • 10. Why Erlang? •  Originally designed for telephone switches by Ericsson •  Much easier to develop scalable and fault tolerant systems (by factors) •  See Motorola presentation: http://www.slideshare.net/Arbow/comparing- cpp-and-erlang-for-motorola-telecoms-software •  Good tool for reliable and scalable systems
  • 11. Erlang‘s Model Monitor Link to monitor, restart Light Light Light weight Messages weight Messages weight process process process with with with state state state
  • 12. Why Erlang? •  Let it crash –  If a process fails, it can be easily restarted –  Different approach to fault tolerance –  Otherwise lots of error handling •  Message Passing in the Core –  RabbitMQ is a messaging system… •  Light-weight process model –  Scales to massive numbers of connections
  • 14. Very Basic AMQP •  Queues: Store messages •  Queues might be –  Durable: Survive server restarts –  Exclusive: For one connection –  autoDelete: Deleted if connection closes •  All resources are dynamic •  Producer sends a message to a Queue
  • 15. Code ConnectionFactory conFactory = new CachingConnectionFactory ("localhost"); RabbitAdmin admin = new RabbitAdmin(conFactory); admin.declareQueue(
 new Queue("myQueue", false, true, true)); RabbitTemplate template = new RabbitTemplate(conFactory); template.convertAndSend("myQueue", "Hi AMQP!"); String receive = (String) template.receiveAndConvert("myQueue"); Assert.assertEquals("Hi AMQP!", receive);
  • 16. Spring’s MessageConverter •  Messages are binary data •  RabbitTemplate uses MessageConverter to convert between objects and messages •  E.g. JSON, Serialization, XML … •  Can also send binary data if preferred
  • 17. Basics of AMQP •  Sending messages directly to queues is not enough •  What about e.g. pub / sub? •  Exchange: Route messages (stateless) •  Example used the default exchange •  More dynamic, flexible and cleaner than JMS
  • 18. AMQP  in  a  nutshell   Exchange routes message Stateless Usually created by producer No queue: Message discarded X Binding binds an Exchange to a Queue Queues buffer messages Usually created by consumer
  • 19. AMQP  in  a  nutshell   Producer and Consumer might be written in Java, C#, Python, Ruby … C P X C AMQP RabbitMQ AMQP protocol protocol
  • 21. X Exchange: Route Messages •  The type of Exchange defines the routing algorithm •  Binding provides selector for routing •  Exchange is addressed by name •  Some standard types •  Can provide additional ones
  • 22. X Fanout Exchange •  Broadcast to all bound queues •  Fast •  Simple •  amq.fanout is mandatory •  To broadcast information
  • 23. X Fanout Exchange C P X C Fanout C
  • 24. Queue fanoutQueue = new Queue("fanoutQueue"); admin.declareQueue(fanoutQueue); FanoutExchange fanoutExchange= new FanoutExchange("myFanout"); admin.declareExchange(fanoutExchange); admin.declareBinding( BindingBuilder.bind(fanoutQueue). to(fanoutExchange)); template.setExchange("myFanout"); template.convertAndSend("Hi Fanout!"); String receive = (String) template.receiveAndConvert("fanoutQueue"); Assert.assertEquals("Hi Fanout!", receive);
  • 25. X Direct Exchange •  Routing based on one routing key •  amq.direct and the default Exchange (no name) always exist •  To send work orders to a specific worker
  • 26. Direct Exchange normal express Direct Exchange C express P X C normal C
  • 27. X Topic Exchange •  Routing based on routing pattern •  amq.topic is mandatory •  E.g. for public / subscribe scenarios
  • 28. Topic Exchange   order.DE invoice.USD Topic Exchange order.* P X C invoice.* C
  • 29. X Headers Exchange •  Routing based on one or more headers and an expression •  amqp.match is mandatory •  Complex routing roles
  • 30. Other Features •  Message can be persistent •  Request / response using correlations possible •  Redelivery / acknowledgement possible •  Clustering with e.g. Linux HA possible •  ...or send message through multiple channels and drop duplicates
  • 32. The MessageListener •  So far: Calling receive() on RabbitTemplate •  Needed: Something that is called when a new message appears
  • 33. Spring’s MessageListener Container •  Spring provides lightweight containers to call MessageListeners •  SimpleMessageListenerContainer •  Advanced scheduling and endpoint management options available •  i.e. thread pools, concurrent consumers, transaction handling
  • 34. Spring's message-driven objects •  MessageListener means the receiver depends on Spring API •  Why not just a POJO?
  • 35. Message-driven POJO <rabbit:listener-container connection-factory="connectionFactory“ message-converter="jsonMessageConverter"> <rabbit:listener ref="consumer" method="consume" queue-names="my.amqp.queue2" /> </rabbit:listener-container> •  Takes a POJO and makes it a MessageListener •  i.e. calls consume on Bean consume
  • 36. @Component Consumer code public class Consumer { public String consume(String message) { return …; } } •  No dependency on AMQP! •  But: What about the result of the method? •  Send to the Reply-To address given in message properties with same correlationId as original method
  • 37. Client Code String response = (String) rabbitTemplate.convertSendAndReceive( "my.fanout", "", "test"); •  Message sent to destination with routing key •  Reply-To set to exclusive, autodelete, non- durable queue •  Response received through Reply-To converted and returned •  Easy request-response! •  Beware of potential latency
  • 39. Web Messaging •  Goal: Send / receive messages in the browser •  With JavaScript •  I.e. JavaScript must receive message •  HTML5 browser: WebSockets •  Pre HTML5: long polling etc
  • 40. SockJS •  Unifies Web Sockets, long polling etc •  Unified JavaScript API •  Server component •  Can run embedded in RabbitMQ
  • 41. STOMP •  Simple (or Streaming) Text Oriented Message Protocol •  Very simple protocol for Message Oriented Middleware •  STOMP over SockJS •  See http://www.rabbitmq.com/blog/ 2012/05/14/introducing-rabbitmq-web- stomp/
  • 42. STOMP JavaScript Java SockJS AMQP C# Web Sockets … Long Polling http://127.0.0.1:55670/
  • 43. JavaScript Code WebSocketStompMock = SockJS; var client = Stomp.client('http://localhost:55674/stomp'); … client.send('/topic/test', {}, data); … client.connect('guest', 'guest', function(x) { id = client.subscribe("/topic/test", function(message) { if (message.body) { alert("got message with body " + message.body) } AMQP: Topic exchange }); amq.topic }); with routing key test
  • 44. Conclusion: AMQP •  Ubiquitous Messaging •  AMQP: Protocol standard •  Better scalability •  Dynamic resources
  • 45. Conclusion: Spring AMQP •  Easy to use •  Flexible (e.g. message encoding) •  Allows scalable message handling •  Full support for AMQP and RabbitMQ
  • 46. Conclusion: Web Messaging •  Simple API •  Works on older browsers •  Single server – also for messaging •  Erlang is very well able to handle the many connections
  • 47. More •  http://springsource.org/spring-amqp •  Also a .NET version available •  …and support in Spring Integration •  …and there is very similar Spring JMS support •  http://blog.springsource.com/2011/04/01/routing- topologies-for-performance-and-scalability-with- rabbitm •  https://github.com/zanox/rabbiteasy –  CDI event / AMQP integration –  Managed publisher and consumer