Book Image

Mastering RabbitMQ

By : Yusuf Aytas, Emrah Ayanoglu, Dotan Nahum
Book Image

Mastering RabbitMQ

By: Yusuf Aytas, Emrah Ayanoglu, Dotan Nahum

Overview of this book

RabbitMQ is one of the most powerful Open Source message broker software, which is widely used in tech companies such as Mozilla, VMware, Google, AT&T, and so on. RabbitMQ gives you lots of fantastic and easy-to-manage functionalities to control and manage the messaging facility with lots of community support. As scalability is one of our major modern problems, messaging with RabbitMQ is the main part of the solution to this problem This book explains and demonstrates the RabbitMQ server in a detailed way. It provides you with lots of real-world examples and advanced solutions to tackle the scalability issues. You’ll begin your journey with the installation and configuration of the RabbitMQ server, while also being given specific details pertaining to the subject. Next, you’ll study the major problems that our server faces, including scalability and high availability, and try to get the solutions for both of these issues by using the RabbitMQ mechanisms. Following on from this, you’ll get to design and develop your own plugins using the Erlang language and RabbitMQ’s internal API. This knowledge will help you to start with the management and monitoring of the messages, tools, and applications. You’ll also gain an understanding of the security and integrity of the messaging facilities that RabbitMQ provides. In the last few chapters, you will build and keep track of your clients (senders and receivers) using Java, Python, and C#.
Table of Contents (18 chapters)
Mastering RabbitMQ
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Preface

RabbitMQ is an open source messaging broker. It's often referred to as a message-oriented middleware that implements the Advanced Message Queuing Protocol (AMQP). Fundamentally, RabbitMQ provides a common platform for sending and receiving messages, where it guarantee the safety of messages until they are received. By playing an intermediary role between message consumers and producers, AMQP makes it easy to decouple applications.

Out of the box, RabbitMQ provides support for many messaging patterns. RabbitMQ guarantees data delivery, provides non-blocking operations, and sends push notifications. Moreover, it provides infrastructure for publish/subscribe, asynchronous processing, and work queues.

RabbitMQ provides a variety of features, including the tuning of application performance, clustering, flexible routing, federation, and so on. If you need specific features, RabbitMQ has several plugins that cater different needs. The RabbitMQ plugins extend its features in different ways, and you can also write your own plugin.

Through this book, we aim to give you a deep understanding of RabbitMQ and its use cases by providing multiple opportunities to learn about the message-oriented middleware, messaging architecture, messaging patterns, and solutions to real-life scenarios using RabbitMQ.

What this book covers

This book covers many aspects of software development with RabbitMQ. It provides thorough understanding of messaging, RabbitMQ, message-oriented software development, and so on.

Chapter 1, Getting Started, introduces you to message queues, message brokers, AMQP, and RabbitMQ.

Chapter 2, Configuring RabbitMQ, covers the configuration opportunities in RabbitMQ in detail.

Chapter 3, Architecture and Messaging, goes over RabbitMQ components—Producer, Message Broker, Consumer and the Message. This chapter provides learning opportunities for interoperability, heterogeneous integration, scalability, and so on.

Chapter 4, Clustering and High Availability, provides opportunities to tune RabbitMQ for high availability, federation, and much more.

Chapter 5, Plugins and Plugin Development, highlights several important features of RabbitMQ and gives an insight into creating your own plugin.

Chapter 6, Managing Your RabbitMQ Server, covers in detail the management of RabbitMQ using the command-line tools, management plugin, and rest API.

Chapter 7, Monitoring, discusses the methods to monitor RabbitMQ instances through a command line, management plugin, and well-known monitoring software.

Chapter 8, Security in RabbitMQ, covers the details about potential security vulnerabilities and securing RabbitMQ.

Chapter 9, Java RabbitMQ Client Programming, talks about developing RabbitMQ client using the Java platform.

Chapter 10, Ruby Client Programming, talks about developing a RabbitMQ client using Ruby.

Chapter 11, Python Client Programming, demonstrates developing a RabbitMQ client using Python.

What you need for this book

For this book, you need an understanding of software development—how to write functions, classes, and debugging skills. Moreover, you also need hands-on experience in developing applications.

Who this book is for

If you are an intermediate-level RabbitMQ developer and want to achieve professional-level expertise in the subject, this book is for you. You'll also need to have a decent understanding of message queuing.

Conventions

In this book, you will find a number of text styles that distinguish between different kinds of information. Here are some examples of these styles and an explanation of their meaning.

Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "We have the dpkg dependency management tool for installing RabbitMQ."

A block of code is set as follows:

tcp {
  upstream cluster {
    # simple round-robin
    server 192.168.1.1:5672;
    server 192.168.1.2:5672;
    check interval=3000 rise=2 fall=5 timeout=1000;
  }
  server {
    listen 5672;
    proxy_pass cluster;
  }
}

Any command-line input or output is written as follows:

mastering-rabbitmq1$ rabbitmqctl cluster_status
Cluster status of node rabbit@mastering-rabbitmq1 ...
[{nodes,[{disc,[rabbit@mastering-rabbitmq1]}]},
 {running_nodes,[rabbit@mastering-rabbitmq1]},
 {partitions,[]}]
...done.

New terms and important words are shown in bold. Words that you see on the screen, for example, in menus or dialog boxes, appear in the text like this: "In Windows, we should use the environment variables of the System Properties for modifying the environment variables of RabbitMQ."

Note

Warnings or important notes appear in a box like this.

Tip

Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or disliked. Reader feedback is important for us as it helps us develop titles that you will really get the most out of.

To send us general feedback, simply e-mail , and mention the book's title in the subject of your message.

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide at www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Downloading the example code

You can download the example code files from your account at http://www.packtpub.com for all the Packt Publishing books you have purchased. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you could report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting your book, clicking on the Errata Submission Form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded to our website or added to any list of existing errata under the Errata section of that title.

To view the previously submitted errata, go to https://www.packtpub.com/books/content/support and enter the name of the book in the search field. The required information will appear under the Errata section.

Piracy

Piracy of copyrighted material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works in any form on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at with a link to the suspected pirated material.

We appreciate your help in protecting our authors and our ability to bring you valuable content.

Questions

If you have a problem with any aspect of this book, you can contact us at , and we will do our best to address the problem.