RabbitMQ Essentials - Second Edition

Book description

Learn basic to advanced RabbitMQ techniques with the help of a realistic case study shared by the experts from CloudAMQP

Key Features

  • Delve into message queues with this comprehensive RabbitMQ guide
  • Explore message queue architecture evolution with the help of a realistic case study
  • Discover strategies for improving scalability and fault tolerance of a message queue architecture

Book Description

RabbitMQ is an open source message queuing software that acts as a message broker using the Advanced Message Queuing Protocol (AMQP). This book will help you to get to grips with RabbitMQ to build your own applications with a message queue architecture. You'll learn from the experts from CloudAMQP as they share what they've learned while managing the largest fleet of RabbitMQ clusters in the world.

Following the case study of Complete Car, you'll discover how you can use RabbitMQ to provide exceptional customer service and user experience, and see how a message queue architecture makes it easy to upgrade the app and add features as the company grows. From implementing simple synchronous operations through to advanced message routing and tracking, you'll explore how RabbitMQ streamlines scalable operations for fast distribution. This book will help you understand the advantages of message queue architecture, including application scalability, resource efficiency, and user reliability. Finally, you'll learn best practices for working with RabbitMQ and be able to use this book as a reference guide for your future app development projects.

By the end of this book, you'll have learned how to use message queuing software to streamline the development of your distributed and scalable applications.

What you will learn

  • Get well versed with RabbitMQ's message queue architecture and features
  • Discover the benefits of RabbitMQ, AMQP, and message queuing
  • Install and configure RabbitMQ and its plugins
  • Get to grips with the management console features and controls
  • Understand how queue and exchange types differ and when and how to use them
  • Get the hang of channels, routing strategies, and direct exchanges
  • Implement best practices to work smoothly with message queues

Who this book is for

If you are a professional enterprise developer or someone who just codes for fun, RabbitMQ Essentials is a valuable resource on open-source message queue architecture. Even those already familiar with microservices and messaging will discover value in reading this book for an exploration of moving forward with best practices and resource efficiency. This book will give you the push you need to get started with creating new and exciting applications or migrating existing monoliths to a microservice architecture.

Publisher resources

Download Example Code

Table of contents

  1. Title Page
  2. Copyright and Credits
    1. RabbitMQ Essentials Second Edition
  3. About Packt
    1. Why subscribe?
  4. Contributors
    1. About the authors
    2. About the reviewer
    3. Packt is searching for authors like you
  5. Preface
    1. Who this book is for
    2. What this book covers
    3. To get the most out of this book
      1. Download the example code files
      2. Download the color images
      3. Conventions used
    4. Get in touch
      1. Reviews
  6. A Rabbit Springs to Life
    1. Technical requirements
    2. Explaining message queues
    3. Discovering AMQP and RabbitMQ
      1. The request-response message exchange pattern
      2. Message queuing exchange pattern
      3. A loosely coupled architecture
      4. Meet AMQP
      5. The RabbitMQ broker
    4. Using RabbitMQ in real life
      1. Message queues between microservices
      2. Event and tasks
    5. Exploring the benefits of message queuing
    6. A RabbitMQ scenario
    7. Getting ready for RabbitMQ
      1. Installing the broker
        1. RabbitMQ installation on Ubuntu
        2. RabbitMQ installation on Docker
        3. Starting RabbitMQ
        4. Downloading the example code
        5. Verifying that the RabbitMQ broker is running
      2. Installing the management plugin (Web UI)
      3. Configuring users
        1. Configuring dedicated vhosts
    8. Summary
  7. Creating a Taxi Application
    1. Technical requirements
    2. The application architecture behind CC
    3. Establishing a solid connection to RabbitMQ
      1. Working with channels
      2. Building the taxi request tool
        1. The direct exchange
    4. Sending the first messages
      1. AMQP message structure
      2. Consuming messages
        1. Acknowledgment and negative acknowledgment
        2. Running the code
      3. Running the application
    5. Adding topic messages
    6. Summary
  8. Sending Messages to Multiple Taxi Drivers
    1. Technical requirements
    2. Working with channels and queues
    3. Specifying a consumer prefetch count
      1. Setting the correct prefetch value
    4. Acknowledging messages
    5. Publishing to all queues
      1. Fanout exchange
      2. Binding to the fanout
      3. Running the application
    6. Summary
  9. Tweaking Message Delivery
    1. Technical requirements
    2. Handling dead letters
      1. Refactoring queues
      2. Undertaking messages
        1. Delayed messages with RabbitMQ
    3. Making delivery mandatory
      1. Default exchanges in RabbitMQ
      2. Implementing the back office sender
    4. Summary
  10. Message Routing
    1. Technical requirements
    2. Sending responses to the publisher
      1. WebSockets in RabbitMQ
        1. Enabling the Web STOMP plugin
        2. Securing Web STOMP with SSL 
        3. Creating and publishing GPS data to the queue
        4. Subscribing to GPS and driver information via WebSockets
    3. Reply-to queues and RPC
    4. Creating a data analysis service
    5. Summary
  11. Taking RabbitMQ to Production
    1. Technical requirements
    2. Adding nodes to the cluster
      1. Connecting to the cluster
      2. Partition handling strategies
    3. Discovering the types of RabbitMQ queues
      1. Mirroring queues
      2. Quorum queues
      3. Lazy queues
    4. Using federated brokers and log aggregation
      1. Handling log processing 
    5. Summary
  12. Best Practices and Broker Monitoring
    1. How to avoid losing messages
      1. Using a dead letter exchange
      2. Handling acknowledgments and confirms
      3. Best practices of message handling
        1. Limiting message size
        2. Using consumers and prefetching
    2. Keeping queues and brokers clean
      1. Setting the TTL for messages or the max-length on queues
      2. Auto-deleting unused queues
    3. Routing best practices
      1. Designing a system with routing in mind
    4. Networking over connections and channels
      1. Using TLS and AMQPS for security
      2. Separate connections
      3. Splitting queues over different cores
        1. RabbitMQ sharding
        2. Consistent Hash Exchange
    5. Exploring key takeaways
    6. Monitoring – querying the REST API
    7. Summary
  13. Other Book You May Enjoy
    1. Leave a review - let other readers know what you think

Product information

  • Title: RabbitMQ Essentials - Second Edition
  • Author(s): Lovisa Johansson, David Dossot
  • Release date: August 2020
  • Publisher(s): Packt Publishing
  • ISBN: 9781789131666