You are previewing RabbitMQ Cookbook.
O'Reilly logo
RabbitMQ Cookbook

Book Description

Knowing a reliable enterprise messaging system based on the AMQP standard can be an essential for today’s software developers. This cookbook helps you learn all the basics of RabbitMQ through recipes, code, and real-life examples.

  • Create scalable distributed applications with RabbitMQ

  • Exploit RabbitMQ on both Web and mobile platforms

  • Deploy message services on cloud computing platforms

  • Full of screenshots and descriptions with clear, step-by-step instructions and practical examples

  • In Detail

    RabbitMQ is an open source message broker software (sometimes called message-oriented middleware) that implements the Advanced Message Queuing Protocol (AMQP). The RabbitMQ server is written in the Erlang programming language and is built on the Open Telecom Platform framework for clustering and failover. Messaging enables software applications to connect and scale. Applications can connect to each other as components of a larger application or to user devices and data.

    RabbitMQ Cookbook touches on all the aspects of RabbitMQ messaging. You will learn how to use this enabling technology for the solution of highly scalable problems dictated by the dynamic requirements of Web and mobile architectures, based for example on cloud computing platforms. This is a practical guide with several examples that will help you to understand the usefulness and the power of RabbitMQ.

    This book helps you learn the basic functionalities of RabbitMQ with simple examples which describe the use of RabbitMQ client APIs and how a RabbitMQ server works. You will find examples of RabbitMQ deployed in real-life use-cases, where its functionalities will be exploited combined with other technologies. This book helps you understand the advanced features of RabbitMQ that are useful for even the most demanding programmer. Over the course of the book, you will learn about the usage of basic AMQP functionalities and use RabbitMQ to let decoupled applications exchange messages as per enterprise integration applications. The same building blocks are used to implement the architecture of highly scalable applications like today's social networks, and they are presented in the book with some examples. You will also learn how to extend RabbitMQ functionalities by implementing Erlang plugins.

    This book combines information with detailed examples coupled with screenshots and diagrams to help you create a messaging application with ease.

    Table of Contents

    1. RabbitMQ Cookbook
      1. Table of Contents
      2. RabbitMQ Cookbook
      3. Credits
      4. About the Authors
      5. About the Reviewers
      6. www.PacktPub.com
        1. Support files, eBooks, discount offers and more
          1. Why Subscribe?
          2. Free Access for Packt account holders
      7. Preface
        1. What this book covers
        2. What you need for this book
        3. Who this book is for
        4. Conventions
        5. Reader feedback
        6. Customer support
          1. Downloading the example code
          2. Errata
          3. Piracy
          4. Questions
      8. 1. Working with AMQP
        1. Introduction
        2. Connecting to the broker
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
        3. Producing messages
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
            1. How to check the RabbitMQ status
            2. Checking whether a queue already exists
        4. Consuming messages
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
            1. More on consumer threads
            2. Blocking semantics
          5. See also
        5. Using body serialization with JSON
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
        6. Using RPC with messaging
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
            1. Using blocking RPC
            2. Scalability notes
        7. Broadcasting messages
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
        8. Working with message routing using direct exchanges
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
        9. Working with message routing using topic exchanges
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
        10. Guaranteeing message processing
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
        11. Distributing messages to many consumers
          1. Getting ready
          2. How to do it…
          3. How it works...
          4. See also…
        12. Using message properties
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
        13. Messaging with transactions
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
        14. Handling unroutable messages
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
      9. 2. Going beyond the AMQP Standard
        1. Introduction
        2. How to let messages expire
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        3. How to let messages expire on specific queues
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        4. How to let queues expire
          1. Getting ready
          2. How to do it...
          3. How it works...
        5. Managing rejected or expired messages
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
        6. Understanding the alternate exchange extension
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
        7. Understanding the validated user-ID extension
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        8. Notifying the consumers of queue failures
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        9. Understanding the exchange-to-exchange extension
          1. Getting ready
          2. How to do it...
          3. How it works...
        10. Embedding message destinations within messages
          1. Getting ready
          2. How to do it....
          3. How it works...
          4. There's more...
      10. 3. Managing RabbitMQ
        1. Introduction
        2. Using vhosts
          1. Getting ready
          2. How to do it…
          3. How it works…
        3. Configuring users
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
            1. User tags for the management plugin
        4. Using SSL
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
        5. Implementing client-side certificates
          1. Getting ready
          2. How to do it…
          3. How it works…
        6. Managing RabbitMQ from a browser
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
        7. Configuring RabbitMQ parameters
          1. How to do it…
          2. How it works…
          3. There's more…
        8. Developing Python applications to monitor RabbitMQ
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
        9. Developing your own web applications to monitor RabbitMQ
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
      11. 4. Mixing Different Technologies
        1. Introduction
        2. Using a .NET client
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
        3. Binding an app from iPhone to RabbitMQ via MQTT
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
        4. Using messaging to update Google Maps on Android
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
        5. Publishing messages from Android in the background
          1. Getting ready…
          2. How to do it…
          3. How it works…
          4. There's more…
        6. Exchanging RabbitMQ messages with Qpid
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
        7. Exchanging RabbitMQ messages with Mosquitto
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
        8. Binding a WCF application with .Net clients
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
      12. 5. Using RabbitMQ in Web Applications
        1. Introduction
        2. Developing web monitoring applications with Spring
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
        3. Developing asynchronous web searches with Spring
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
        4. Developing web monitoring applications with STOMP
          1. Getting ready
          2. How to do it…
          3. How it works…
      13. 6. Developing Scalable Applications
        1. Introduction
        2. Creating a localhost cluster
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
        3. Creating a simple cluster
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
        4. Adding a RabbitMQ cluster automatically
          1. Getting ready
          2. How to do it…
          3. How it works…
        5. Introducing a load balancer to consumers
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
        6. Creating clients of the cluster
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
      14. 7. Developing High-availability Applications
        1. Introduction
        2. Mirroring queues
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
        3. Synchronizing queues
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
        4. Optimizing mirror policies
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
        5. Distributing messages between a couple of brokers
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
        6. Creating a geographical cluster replication
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
        7. Filtering and forwarding messages
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
        8. Combining high-availability technologies together
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
        9. Client high availability
          1. Getting ready
          2. How to do it…
          3. How it works…
      15. 8. Performance Tuning for RabbitMQ
        1. Introduction
        2. Multithreading and queues
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
        3. System tuning
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
        4. Improving bandwidth
          1. Getting ready
          2. How to do it…
          3. How it works…
            1. Prefetch
            2. NoAck
          4. There's more…
          5. See also
        5. Using different distribution tools
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
      16. 9. Extending RabbitMQ Functionality
        1. Introduction
        2. Enabling and configuring the STOMP plugin
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
        3. Managing a RabbitMQ cluster
          1. Getting ready
          2. How to do it…
          3. How it works…
        4. Monitoring Shovel status
          1. Getting ready
          2. How to do it…
          3. How it works…
        5. Developing new plugins – attaching to a relational database with ODBC
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
      17. 10. RabbitMQ on AWS
        1. Introduction
        2. Using RabbitMQ EC2 instances
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
        3. Creating a master image
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. See also
        4. Creating a cluster with two EC2 instances
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
        5. Using AWS Load Balancing in front of a RabbitMQ cluster
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
        6. Configuring EC2 dynamic bind
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
        7. Dealing with load spikes and resource optimization in the cloud
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
      18. 11. AMQP and Cloud Computing – RabbitMQ on PaaS
        1. Introduction
        2. RabbitMQ on CloudAMQP
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
        3. First application on Cloud Foundry
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
        4. Using RabbitMQ on Cloud Foundry
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
      19. 12. Managing RabbitMQ Error Conditions
        1. Introduction
        2. Monitoring RabbitMQ's behavior
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
        3. Using RabbitMQ to troubleshoot itself
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
        4. Tracing RabbitMQ's ongoing activity
          1. Getting ready
          2. How to do it...
          3. How it works...
        5. Debugging RabbitMQ's messages
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        6. What to do when RabbitMQ fails to restart
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        7. Debugging using Wireshark
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more…
          5. See also
      20. Index