SlideShare a Scribd company logo
High Powered Messaging withJames CarrSoftware EngineerOCI
About Your Speaker
A Brief Introduction to MessagingHow can I integrate multiple applications to work together and share data?Use Messaging to transfer packets of data frequently, immediately, reliably, and asynchronously, using customizable formats.
You might need messaging if…Need to integrate different systems to work togetherNeed to scaleNeed to be able to monitor data feedsDecoupled Publishers and SubscribersQueuing and Buffering for later delivery
You Might Not Need Messaging If…Just need single process asynchronous behaviorWant to just isolate concepts within the application (package scope or even OSGi might work better here)Use your best judgement! 
The Bible On MessagingIgnore all the SOA books, if you really want to dig deep and understand messaging, I suggest
Brief Overview of MessagingBefore we dig deep, it’s good to have a brief overview of concepts that are used in messaging
Message BrokerHow do we decouple the destination from the sender?Manages the routing of messages to intended destinations
Message ChannelA message channel is what connects two peersSender writes to channel, receiver reads from channel
Point-to-Point ChannelA channel that connects one sender with only one reciever
Publish-Subscribe ChannelDelivers a copy of the message to each receiver subscribing to the channel
Dead Letter ChannelWhere a messaging system sends a message that is undeliverable
Dynamic RouterRoute a message to different receiver based on some property of the message
The Sad State of MessagingMessage oriented middleware is the “holy grail” of many enterprises
Lots and lots of vendor locked in solutions exist (yes, I’m looking at YOU, Oracle)
Complex, proprietary, and closed
Support contracts and licensing fees can shoot into the stratosphereEPIC FAIL
Open Standards to the Rescue!AMQPSTOMPXMPPJSON-RPCFor this presentation I’ll mostly cover AMQP, but delve a little into STOMP
       AMQP Features
Where? Who?
AMQPAdvanced Message Queuing PrototcolDefines the wire level protocol (whereas JMS defines only an API)Completely open and specified by the AMQP Working GroupIncludes many companies, such as J.P. Morgan, Bank of America, Cisco, Red Hat, iMatrix, Rabbit Technologies, etc.Defines the semantics of server and client behavior to ensure interoperability.
A Quick Overview
Components of AMQPBroker – Manages exchanges, queues, etc.Channel – Logical representation of the connection, maintains stateExchanges – entities to which a message is sentQueues – receive messages sent to an exchangeBinding – Relationship between an exchange and a queueMessages – The actual message sent and received. Two important parts: a routing key and the body
Message HeadersRouting Key – used to route messages, dependent on the type of exchange (more on this soon)Priority – a value 0 to 9 that indicates if this message has priority in queues over othersDelivery-mode – can be used to indicate if the message will need persistence. Expiration – duration in milliseconds that the broker should use to dertermine of the  message is unroutable.
Exchange TypesDirect: if a queue is bound with routing key “A” only messages with that routing key will be sent to the queue. Topic: broker will match the routing key against a pattern to dermine which queue to send to. For example, “uk.#” will receive any messages with a key starting with “uk.”Fanout: 1 to N delivery pattern in which routing keys are ignored. All queues bound to the exchange will receive the message.
ExchangesWho creates exchanges?Clients do. Other configurable properties: Passive: will not create the exchange, but will fail if it doesn’t exist.Durable: exchange will survive a broker restartAuto-delete: exchange will get deleted as soon as there are no more queues bound to it.
QueuesQueues receive messages, in orderConsumers subscribe to queuesConsumers can also consume the queue as they see fit Inherits the same properties an exchange has (durable, auto-delete,passive) with a couple additional ones:Exclusive: only one client can subscribe to this queueAlternate-exchange: exchange to reroute rejected or orphaned messages
BindingSpecifies how messages flow from exchange to queueMatch the routing algorithm used in the exchangeDirect: “foo.bar.baz”Fanout: “#”Topic: “foo.*.baz” or “foo.#”
Check out http://www.amqp.org if you want to learn more.
AMQP BrokersActiveMQ - http://activemq.apache.org/ZeroMQ(integrates with) – http://zeromq.orgApache Qpid - http://qpid.apache.org/RabbitMQ - http://www.rabbitmq.com/
Why RabbitMQ?Built on top of Open Telecom Platform erlang librariesUsed by leading telecom companies for high performance distributed network applicationsClustering supportImplements the latest AMQP spec (0.9)Various plugins for additional features (json-rpc, STOMP, HTTP, etc)Popular framework integration: Spring, grails, rails, node.js, etc.
High powered messaging with RabbitMQ
Side Note…Personally I like ActiveMQ because it’s easy to embed within an existing java application It also supports STOMP over websocketsI often do this for integration tests against components that interact with JMSYou can also do this and hit rabbitmq in the real app as well (Open Standards FTW)Okay, that’s kind of a moot point, in java I can do this if I use Weblogic JMS, SeriesMQ, etc.
Commandline ControlStart up: rabbitmqctlstart_appStatus: rabbitmqctl statusList queues: rabbitmqctllist_queues
Enough Jibber Jabber! Show me an example fool!
Use CaseSite written in node.js needs to make use of existing, well established JEE backend servicesWe want the whole operation to be asynchronousNode.js sends message on exchange AJEE application picks up message off queue, does work, sends message out on exchange BNode.js picks message up off queue and does required work.
Using RabbitMQ in JavaThe client library from the rabbitmq siteApache camel’s amqp component to send and receive messages from rabbitmqspring-amqp (currently available as a milestone release, 1.0.0.M1)This means you mavenizers will need to use the alternate repository locationhttp://maven.springframework.org/milestoneThere’s also a rabbitmq grails plugin. 

More Related Content

PDF
Alvaro Videla, Building a Distributed Data Ingestion System with RabbitMQ
PPTX
Spring RabbitMQ
PDF
PDF
Architecture | The Future of Messaging: RabbitMQ and AMQP | Eberhard Wolff
PDF
Dissecting the rabbit: RabbitMQ Internal Architecture
PDF
Messaging Standards and Systems - AMQP & RabbitMQ
PPTX
The RabbitMQ Message Broker
PPTX
Scaling application with RabbitMQ
Alvaro Videla, Building a Distributed Data Ingestion System with RabbitMQ
Spring RabbitMQ
Architecture | The Future of Messaging: RabbitMQ and AMQP | Eberhard Wolff
Dissecting the rabbit: RabbitMQ Internal Architecture
Messaging Standards and Systems - AMQP & RabbitMQ
The RabbitMQ Message Broker
Scaling application with RabbitMQ

What's hot (20)

PDF
RabbitMQ fairly-indepth
PDF
RabbitMQ with python and ruby RuPy 2009
PDF
Scaling applications with RabbitMQ at SunshinePHP
PDF
RabbitMQ Data Ingestion
PDF
AMQP with RabbitMQ
PDF
The Future of Messaging: RabbitMQ and AMQP
PDF
Introduction to AMQP Messaging with RabbitMQ
PDF
RabbitMQ Operations
PDF
Messaging with RabbitMQ and AMQP
PDF
Practical Message Queuing Using RabbitMQ (PHPem, 3rd July 2014)
PPTX
RabbitMQ Model and Some Example Applications
PDF
Integrating PostgreSql with RabbitMQ
ODP
Introduction To RabbitMQ
PDF
Messaging with amqp and rabbitmq
PPTX
Message Broker System and RabbitMQ
PDF
Distributed messaging with AMQP
PPTX
Spring RabbitMQ
PDF
Messaging Standards and Systems - AMQP & RabbitMQ
PDF
Distributed and concurrent programming with RabbitMQ and EventMachine Rails U...
PDF
[@NaukriEngineering] Messaging Queues
RabbitMQ fairly-indepth
RabbitMQ with python and ruby RuPy 2009
Scaling applications with RabbitMQ at SunshinePHP
RabbitMQ Data Ingestion
AMQP with RabbitMQ
The Future of Messaging: RabbitMQ and AMQP
Introduction to AMQP Messaging with RabbitMQ
RabbitMQ Operations
Messaging with RabbitMQ and AMQP
Practical Message Queuing Using RabbitMQ (PHPem, 3rd July 2014)
RabbitMQ Model and Some Example Applications
Integrating PostgreSql with RabbitMQ
Introduction To RabbitMQ
Messaging with amqp and rabbitmq
Message Broker System and RabbitMQ
Distributed messaging with AMQP
Spring RabbitMQ
Messaging Standards and Systems - AMQP & RabbitMQ
Distributed and concurrent programming with RabbitMQ and EventMachine Rails U...
[@NaukriEngineering] Messaging Queues
Ad

Viewers also liked (17)

PPT
Amqp Basic
PDF
Integrating RabbitMQ with PHP
PDF
Everything you always wanted to know about Redis but were afraid to ask
PDF
Introduction to Heroku Postgres
PDF
Scaling RabbitMQ to 11
PDF
AMQP: interopérabilité et découplage de systèmes hétérogènes avec RabbitMQ
PPTX
Roman Kuznietsov: Zeromq: sockets on steroids.Zero mq
KEY
PDF
Introduction to ActiveMQ Apollo
KEY
Taste Rabbitmq
PDF
新浪微博开放平台Redis实战
PPTX
高性能No sql数据库redis
PDF
Introduction to ZeroMQ - eSpace TechTalk
DOCX
Professional profile
PDF
Open channels
PPTX
AMQP 1.0 introduction
PPTX
Redis介绍
Amqp Basic
Integrating RabbitMQ with PHP
Everything you always wanted to know about Redis but were afraid to ask
Introduction to Heroku Postgres
Scaling RabbitMQ to 11
AMQP: interopérabilité et découplage de systèmes hétérogènes avec RabbitMQ
Roman Kuznietsov: Zeromq: sockets on steroids.Zero mq
Introduction to ActiveMQ Apollo
Taste Rabbitmq
新浪微博开放平台Redis实战
高性能No sql数据库redis
Introduction to ZeroMQ - eSpace TechTalk
Professional profile
Open channels
AMQP 1.0 introduction
Redis介绍
Ad

Similar to High powered messaging with RabbitMQ (20)

ODP
The Art of Message Queues - TEKX
PPTX
RabbitMQ interview Questions and Answers
PPTX
Rabbitmq & Kafka Presentation
PDF
Messaging in Java
PPTX
ActiveMQ interview Questions and Answers
PDF
Wcf faq
PPTX
Apache Camel interview Questions and Answers
PPTX
Message Oriented Middleware
PPTX
RabbitMq
PPT
Service Oriented Development With Windows Communication Foundation 2003
PPTX
Air traffic controller - Streams Processing meetup
PPTX
PPTX
Patterns&Antipatternsof SOA
PPT
Messaging - RabbitMQ, Azure (Service Bus), Docker and Azure Functions
PDF
quickguide-einnovator-11-spring-integration
ODP
Art Of Message Queues
PPTX
Beyond REST and RPC: Asynchronous Eventing and Messaging Patterns
PPTX
Apache kafka
PPTX
Integration Patterns With Spring integration
PDF
WSO2 Product Release Webinar Introducing the WSO2 Message Broker
The Art of Message Queues - TEKX
RabbitMQ interview Questions and Answers
Rabbitmq & Kafka Presentation
Messaging in Java
ActiveMQ interview Questions and Answers
Wcf faq
Apache Camel interview Questions and Answers
Message Oriented Middleware
RabbitMq
Service Oriented Development With Windows Communication Foundation 2003
Air traffic controller - Streams Processing meetup
Patterns&Antipatternsof SOA
Messaging - RabbitMQ, Azure (Service Bus), Docker and Azure Functions
quickguide-einnovator-11-spring-integration
Art Of Message Queues
Beyond REST and RPC: Asynchronous Eventing and Messaging Patterns
Apache kafka
Integration Patterns With Spring integration
WSO2 Product Release Webinar Introducing the WSO2 Message Broker

High powered messaging with RabbitMQ

  • 1. High Powered Messaging withJames CarrSoftware EngineerOCI
  • 3. A Brief Introduction to MessagingHow can I integrate multiple applications to work together and share data?Use Messaging to transfer packets of data frequently, immediately, reliably, and asynchronously, using customizable formats.
  • 4. You might need messaging if…Need to integrate different systems to work togetherNeed to scaleNeed to be able to monitor data feedsDecoupled Publishers and SubscribersQueuing and Buffering for later delivery
  • 5. You Might Not Need Messaging If…Just need single process asynchronous behaviorWant to just isolate concepts within the application (package scope or even OSGi might work better here)Use your best judgement! 
  • 6. The Bible On MessagingIgnore all the SOA books, if you really want to dig deep and understand messaging, I suggest
  • 7. Brief Overview of MessagingBefore we dig deep, it’s good to have a brief overview of concepts that are used in messaging
  • 8. Message BrokerHow do we decouple the destination from the sender?Manages the routing of messages to intended destinations
  • 9. Message ChannelA message channel is what connects two peersSender writes to channel, receiver reads from channel
  • 10. Point-to-Point ChannelA channel that connects one sender with only one reciever
  • 11. Publish-Subscribe ChannelDelivers a copy of the message to each receiver subscribing to the channel
  • 12. Dead Letter ChannelWhere a messaging system sends a message that is undeliverable
  • 13. Dynamic RouterRoute a message to different receiver based on some property of the message
  • 14. The Sad State of MessagingMessage oriented middleware is the “holy grail” of many enterprises
  • 15. Lots and lots of vendor locked in solutions exist (yes, I’m looking at YOU, Oracle)
  • 17. Support contracts and licensing fees can shoot into the stratosphereEPIC FAIL
  • 18. Open Standards to the Rescue!AMQPSTOMPXMPPJSON-RPCFor this presentation I’ll mostly cover AMQP, but delve a little into STOMP
  • 19. AMQP Features
  • 21. AMQPAdvanced Message Queuing PrototcolDefines the wire level protocol (whereas JMS defines only an API)Completely open and specified by the AMQP Working GroupIncludes many companies, such as J.P. Morgan, Bank of America, Cisco, Red Hat, iMatrix, Rabbit Technologies, etc.Defines the semantics of server and client behavior to ensure interoperability.
  • 23. Components of AMQPBroker – Manages exchanges, queues, etc.Channel – Logical representation of the connection, maintains stateExchanges – entities to which a message is sentQueues – receive messages sent to an exchangeBinding – Relationship between an exchange and a queueMessages – The actual message sent and received. Two important parts: a routing key and the body
  • 24. Message HeadersRouting Key – used to route messages, dependent on the type of exchange (more on this soon)Priority – a value 0 to 9 that indicates if this message has priority in queues over othersDelivery-mode – can be used to indicate if the message will need persistence. Expiration – duration in milliseconds that the broker should use to dertermine of the message is unroutable.
  • 25. Exchange TypesDirect: if a queue is bound with routing key “A” only messages with that routing key will be sent to the queue. Topic: broker will match the routing key against a pattern to dermine which queue to send to. For example, “uk.#” will receive any messages with a key starting with “uk.”Fanout: 1 to N delivery pattern in which routing keys are ignored. All queues bound to the exchange will receive the message.
  • 26. ExchangesWho creates exchanges?Clients do. Other configurable properties: Passive: will not create the exchange, but will fail if it doesn’t exist.Durable: exchange will survive a broker restartAuto-delete: exchange will get deleted as soon as there are no more queues bound to it.
  • 27. QueuesQueues receive messages, in orderConsumers subscribe to queuesConsumers can also consume the queue as they see fit Inherits the same properties an exchange has (durable, auto-delete,passive) with a couple additional ones:Exclusive: only one client can subscribe to this queueAlternate-exchange: exchange to reroute rejected or orphaned messages
  • 28. BindingSpecifies how messages flow from exchange to queueMatch the routing algorithm used in the exchangeDirect: “foo.bar.baz”Fanout: “#”Topic: “foo.*.baz” or “foo.#”
  • 30. AMQP BrokersActiveMQ - http://activemq.apache.org/ZeroMQ(integrates with) – http://zeromq.orgApache Qpid - http://qpid.apache.org/RabbitMQ - http://www.rabbitmq.com/
  • 31. Why RabbitMQ?Built on top of Open Telecom Platform erlang librariesUsed by leading telecom companies for high performance distributed network applicationsClustering supportImplements the latest AMQP spec (0.9)Various plugins for additional features (json-rpc, STOMP, HTTP, etc)Popular framework integration: Spring, grails, rails, node.js, etc.
  • 33. Side Note…Personally I like ActiveMQ because it’s easy to embed within an existing java application It also supports STOMP over websocketsI often do this for integration tests against components that interact with JMSYou can also do this and hit rabbitmq in the real app as well (Open Standards FTW)Okay, that’s kind of a moot point, in java I can do this if I use Weblogic JMS, SeriesMQ, etc.
  • 34. Commandline ControlStart up: rabbitmqctlstart_appStatus: rabbitmqctl statusList queues: rabbitmqctllist_queues
  • 35. Enough Jibber Jabber! Show me an example fool!
  • 36. Use CaseSite written in node.js needs to make use of existing, well established JEE backend servicesWe want the whole operation to be asynchronousNode.js sends message on exchange AJEE application picks up message off queue, does work, sends message out on exchange BNode.js picks message up off queue and does required work.
  • 37. Using RabbitMQ in JavaThe client library from the rabbitmq siteApache camel’s amqp component to send and receive messages from rabbitmqspring-amqp (currently available as a milestone release, 1.0.0.M1)This means you mavenizers will need to use the alternate repository locationhttp://maven.springframework.org/milestoneThere’s also a rabbitmq grails plugin. 
  • 38. Dirty Details…Licensed under the Mozilla Public LicenseCommercial Support ExistsGet it now, be up and running in minutes.Contribute!
  • 39. LinksMy Node.js example: http://github.com/jamescarr/nodejs-amqp-exampleSpring AMQP: http://www.springsource.org/spring-amqpApache Camel: http://camel.apache.org/RabbitMQhttp://www.rabbitmq.comOpen Source Repository: http://www.rabbitmq.comRabbitMQplugin for grails: http://blog.springsource.com/2010/08/23/rabbitmq-plugin-for-grails-early-access/