![]()
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
![]()
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
![]()
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
![]()
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/).
![]()
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...