Learning RabbitMQ
eBook - ePub

Learning RabbitMQ

  1. 262 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Learning RabbitMQ

About this book

Build and optimize efficient messaging applications with ease

About This Book

  • Learn to administer, configure, and manage RabbitMQ instances
  • Discover ways to secure and troubleshoot RabbitMQ instances
  • This book is fully up-to-date with all the latest changes to version 3.5

Who This Book Is For

If you are a developer or system administrator with a basic knowledge of messaging who wants to learn RabbitMQ, or if you want to further enhance your knowledge in working with the message broker, then this book is ideal for you. To fully understand some examples in the book, a basic knowledge of the Java programming language is required.

What You Will Learn

  • Apply messaging patterns using the message broker
  • Administer RabbitMQ using the command line, management Web console, or management REST services
  • Create a cluster of scalable, and highly-available, RabbitMQ instances
  • Use RabbitMQ with the Spring Framework, MuleESB, WSO2, and Oracle databases
  • Deploy RabbitMQ using Puppet, Vagrant, or Docker
  • Fine-tune the performance of RabbitMQ
  • Monitor RabbitMQ using Nagios, Munin, or Monit
  • Secure, troubleshoot, and extend RabbitMQ

In Detail

RabbitMQ is Open Source Message Queuing software based on the Advanced Message Queue Protocol Standard written in the Erlang Language. RabbitMQ is an ideal candidate for large-scale projects ranging from e-commerce and finance to Big Data and social networking because of its ease of use and high performance. Managing RabbitMQ in such a dynamic environment can be a challenging task that requires a good understanding not only of how to work properly with the message broker but also of its best practices and pitfalls.

Learning RabbitMQ starts with a concise description of messaging solutions and patterns, then moves on to concrete practical scenarios for publishing and subscribing to the broker along with basic administration. This knowledge is further expanded by exploring how to establish clustering and high availability at the level of the message broker and how to integrate RabbitMQ with a number of technologies such as Spring, and enterprise service bus solutions such as MuleESB and WSO2. We will look at advanced topics such as performance tuning, secure messaging, and the internals of RabbitMQ. Finally we will work through case-studies so that we can see RabbitMQ in action and, if something goes wrong, we'll learn to resolve it in the Troubleshooting section.

Style and approach

Each chapter of the book is an easy-to-follow guide that expands and builds on the knowledge already gained in previous chapters. Throughout the course of the book, a sample system called the CSN (Corporate Social Network) is used to illustrate the core principles described. At the end of each chapter, there is a Q&A session that covers practical questions that may arise in practice when working with RabbitMQ.

Tools to learn more effectively

Saving Books

Saving Books

Keyword Search

Keyword Search

Annotating Text

Annotating Text

Listen to it instead

Listen to it instead

Information

Learning RabbitMQ


Table of Contents

Learning RabbitMQ
Credits
About the Author
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why subscribe?
Free access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. Introducing RabbitMQ
Enterprise messaging
Use cases
Solutions
Patterns
Point-to-point
Publish-subscribe
Request-response
Understanding RabbitMQ
Features
Comparison with other technologies
Installation
Linux
Case study: CSN (Corporate Social Network)
Summary
Exercises
2. Design Patterns with RabbitMQ
Messaging patterns in RabbitMQ
Point-to-point communication
Publish-subscribe communication
Request-reply communication
Message router
Case study: Initial design of the CSN
Summary
Exercises
3. Administration, Configuration, and Management
Administering RabbitMQ instances
Administering RabbitMQ components
Administering users
Administering vhosts
Administering permissions
Administering exchanges
Administering queues
Administering bindings
Administering policies
Administering the RabbitMQ database
Full backup and restore
Backing up and restoring the broker metadata
Installing RabbitMQ plugins
Configuring RabbitMQ instances
Setting environment variables
Modifying the RabbitMQ configuration file
Managing RabbitMQ instances
Upgrading RabbitMQ
Case study: Administering CSN
Summary
Exercises
4. Clustering
Benefits of clustering
RabbitMQ clustering support
Creating a simple cluster
Adding nodes to the cluster
Adding RAM-only nodes to the cluster
Removing nodes from a cluster
Connecting to the cluster
Case study: scaling the CSN
Summary
Exercises
5. High Availability
Benefits of high availability
High availability support in RabbitMQ
Mirrored queues
Federation plugin
Shovel plugin
Reliable delivery
AMQP transactions
Publisher confirms
Client high availability
Client reconnections
Load balancing
Case study: introducing high availability in CSN
Summary
Exercises
6. Integrations
Types of integrations
Spring framework
Spring AMQP
Spring Integration
Integration with ESBs
Mule ESB
WSO2
Integration with databases
Oracle RDBMS
MongoDB
Hadoop
RabbitMQ integrations
RabbitMQ deployment options
Puppet
Docker
Vagrant
Testing RabbitMQ applications
Unit testing of RabbitMQ applications
Integration testing of RabbitMQ applications
Case study: Integrating CSN with external systems
Summary
Exercises
7. Performance Tuning and Monitoring
Performance tuning of RabbitMQ instances
Memory usage
Faster runtime execution
Message size
The maximum frame size of messages
The maximum number of channels
Connection heartbeats
Clustering and high availability
QoS prefetching
Message persistence
Mnesia transaction logs
Acknowledgements, transactions and publisher confirms
Message routing
Queue creation/deletion
Queue message TTL
Alarms
Network tuning
Client tuning
Performance testing
Monitoring of RabbitMQ instances
The management UI
Nagios
Monit
Munin
Comparing RabbitMQ with other message brokers
Case Study : Performance tuning and monitoring of RabbitMQ instances in CSN
Summary
Exercises
8. Troubleshooting
General troubleshooting approach
Checking the status of a particular node
Inspecting the RabbitMQ logs
The RabbitMQ mailing list and IRC channel
Erlang troubleshooting
An Erlang Primer
The Erlang crash dump
Problems with starting/stopping RabbitMQ nodes
Problems with message delivery
Summary
Exercises
9. Security
Types of threats
Authentication
Configuring the LDAP backend
Security considerations
Authorization
LDAP authentication
Secure communication
Secure communication with the management interface
Secure cluster communication
EXTERNAL SSL authentication
Penetration testing
Case study – securing CSN
Summary
Exercises
10. Internals
High level architecture of RabbitMQ
Overview of RabbitMQ components
Boot component
Plug-in loader component
Recovery component
Persistence component
Metadata persistence
Message persistence component
Networking component
Other components
Developing plug-ins for RabbitMQ
Case Study: Developing a RabbitMQ plugin for CSN
Summary
Exercises
A. Contributing to RabbitMQ
RabbitMQ community
RabbitMQ repositories
Getting the sources
Building the RabbitMQ server
Points for contribution
Index

Learning RabbitMQ

Copyright © 2015 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author(s), nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: December 2015
Production reference: 1171215
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-78398-456-5
www.packtpub.com

Credits

Author
Martin Toshev
Reviewers
Van Thoai Nguyen
Héctor Veiga
Commissioning Editor
Ashwin Nair
Acquisition Editor
Vinay Argekar
Content Development Editor
Kirti Patil
Technical Editor
Danish Shaikh
Copy Editor
Vibha Shukla
Project Coordinator
Nidhi Joshi
Proofreader
Safis Editing
Indexer
Hemangini Bari
Graphics
Disha Haria
Production Coordinator
Arvindkumar Gupta
Cover Work
Arvindkumar Gupta

About the Author

Martin Toshev is a software developer and Java enthusiast with more than eight years of experience and vast expertise originating from projects in areas such as enterprise Java, social networking, source code analysis, Internet of Things, and investment banking in companies such as Cisco and Deutsche Telekom. He is a graduate of computer science from the University of Sofia. He is also a certified Java professional (SCJP6) and a certified IBM cloud computing solution advisor. His areas of interest include a wide range of Java-related technologies (Servlets, JSP, JAXB, JAXP, JMS, JMX, JAX-RS, JAX-WS, Hibernate, Spring Framework, Liferay Portal, and Eclipse RCP), cloud computing technologies, cloud-based software architectures, enterprise application integration, and relational and NoSQL databases. Martin is one of the leaders of the Bulgarian Java Users group (BGJUG), a regular speaker at Java conferences, and one of the organizers behind the jPrime conference in Bulgaria (http://jprime.io/).

About the Reviewers

Van Thoai Nguyen has worked in the software industry for a decade in various domains. In 2012, he joined BuzzNumbers as one of the core senior software engineers, where he had opportunities to design, implement, and apply many cool technologies, tools, and frameworks. A RabbitMQ cluster was employed as the backbone of the real-time data processing platform, which includes various data collectors, data filtering...

Table of contents

  1. Learning RabbitMQ

Frequently asked questions

Yes, you can cancel anytime from the Subscription tab in your account settings on the Perlego website. Your subscription will stay active until the end of your current billing period. Learn how to cancel your subscription
No, books cannot be downloaded as external files, such as PDFs, for use outside of Perlego. However, you can download books within the Perlego app for offline reading on mobile or tablet. Learn how to download books offline
Perlego offers two plans: Essential and Complete
  • Essential is ideal for learners and professionals who enjoy exploring a wide range of subjects. Access the Essential Library with 800,000+ trusted titles and best-sellers across business, personal growth, and the humanities. Includes unlimited reading time and Standard Read Aloud voice.
  • Complete: Perfect for advanced learners and researchers needing full, unrestricted access. Unlock 1.4M+ books across hundreds of subjects, including academic and specialized titles. The Complete Plan also includes advanced features like Premium Read Aloud and Research Assistant.
Both plans are available with monthly, semester, or annual billing cycles.
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 990+ topics, we’ve got you covered! Learn about our mission
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more about Read Aloud
Yes! You can use the Perlego app on both iOS and Android devices to read anytime, anywhere — even offline. Perfect for commutes or when you’re on the go.
Please note we cannot support devices running on iOS 13 and Android 7 or earlier. Learn more about using the app
Yes, you can access Learning RabbitMQ by Martin Toshev in PDF and/or ePUB format, as well as other popular books in Computer Science & Programming in Java. We have over one million books available in our catalogue for you to explore.