Download as pdf or txt
Download as pdf or txt
You are on page 1of 10

RabbitMQ Essentials

Hop straight into developing your own messaging


applications by learning how to utilize RabbitMQ

David Dossot

BIRMINGHAM - MUMBAI
RabbitMQ Essentials

Copyright © 2014 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, 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: April 2014

Production Reference: 1180414

Published by Packt Publishing Ltd.


Livery Place
35 Livery Street
Birmingham B3 2PB, UK.

ISBN 978-1-78398-320-9

www.packtpub.com
Credits

Author Project Coordinator


David Dossot Puja Shukla

Reviewers Proofreader
Ken Pratt Ameesha Green
Ken Taylor
Ignacio Colomina Torregrosa Indexer
Monica Ajmera Mehta
Héctor Veiga

Graphics
Commissioning Editor
Sheetal Aute
Ashwin Nair
Ronak Dhruv

Acquisition Editor Abhinash Sahu


Richard Harvey
Production Coordinator
Content Development Editor Alwin Roy
Govindan K
Cover Work
Technical Editors Alwin Roy
Shruti Rawool
Nachiket Vartak Cover Image
Sheetal Aute

Copy Editors
Aditya Nair
Kirti Pai
Foreword
What gets me most excited about RabbitMQ is that people keep finding new and
better ways to use it. Messaging has truly come of age and stands beside databases
and web applications as a technology that every professional developer needs
to know.

In 2006, when RabbitMQ was born, messaging was mostly used by companies that
had way too many IT systems and desperately needed some way to connect them.
Jargon words such as "pubsub" and "queue" were strictly for messaging geeks and
highly paid integration consultants. But the world was already changing and we
were about to find out why.

Today's software and web applications are increasing in scale rapidly. There are more
users, apps, devices, places, and ways to connect; this creates a burning need to build
more scalable applications. At the same time, these new applications have to integrate
with existing systems and services written using any language or API you care to
think of. There is only one way to deliver scalability in this kind of environment: use
messaging. The best way to do that is via a product such as RabbitMQ.

We started RabbitMQ because there was no messaging tool that was really powerful
and dependable, yet easy to get started with. We decided to make one. We hope you
like it.

The fun part is designing the tool so that you, the developer, feel like RabbitMQ is
actually helping you to build better apps, instead of getting in the way. Your use of
the tool should grow with your system.
The hard part is balancing simplicity and power. With RabbitMQ, we think we got
this about right. Developers have little tolerance for complexity and nonsense. But
beware! There is such a thing as "fake simplicity"; if a tool makes promises that seem
too good to be true, then something is almost certainly broken. A truly simple system
makes its capabilities obvious when they are needed. RabbitMQ will never lie to you
or conceal its true behavior and we think this is essential in a good tool.

In this book, David Dossot has shown how messaging can help anyone architect and
design solid scalable apps and how RabbitMQ can deliver on this promise. In 2014,
everyone can grok the basics of messaging. Read this book to get started.

Alexis Richardson
Former CEO, Rabbit Technologies Inc.
About the Author

David Dossot has worked as a software engineer and an architect for more than
18 years. He has been using RabbitMQ since 2009 in a variety of different contexts.
He is the main contributor to the AMQP transport for Mule. His focus is on building
distributed and scalable server-side applications for the JVM and the Erlang VM.
He is a member of IEEE, the Computer Society, and AOPA, and holds a diploma in
Production Systems Engineering from ESSTIN.

He is a co-author for the first and second editions of Mule in Action (Manning
Publications Co.). He is a Mule champion and a DZone Most Valuable Blogger.
He commits on multiple open source projects and likes to help people on Stack
Overflow. He's also a judge for the annual Jolt Awards software competition.

I would like to thank my wife for giving the thumbs up to this


book project, while just recovering from the previous book. It was a
stretch goal, but with her support and the patience and love of the
rest of my family, it became possible. I'm also grateful to the rainy
winters we get in the Pacific Northwest as I didn't feel bad staying
inside writing!

I would like to extend a special thanks to our early reviewers—


without them, the book wouldn't be as great as it is now. I want to
use this opportunity to give kudos to a bunch of first class software
engineers and architects who have inspired me and from whom
I've learned so much throughout my career: Romuald van der
Raaij, André Weber, Philip Thomas, Pierre-Antoine Grégoire, Carl
Schmidt, Tim Meighen, Josh Devins, Dominic Farr, Erik Garrett, and
Ken Pratt.
About the Reviewers

Ken Pratt has over 10 years of professional experience in software development,


and knows more programming languages than you can imagine. He has shipped
multiple products powered by RabbitMQ and enjoys discovering new ways to
structure systems.

Ken Taylor has worked in software development and technology for over 15 years.
During the course of his career, he has worked as a systems analyst on multiple
software projects in several industries as well as U.S. government agencies. He has
successfully used RabbitMQ for messaging on multiple projects. He previously
reviewed RabbitMQ Cookbook, written by Sigismondo Boschi and Gabriele Santomaggio,
Packt Publishing. He is a member and speaker of the 757 Ruby users group and the
Hampton Roads .NET Users Group (HRNUG). He holds an A.S. degree in Computer
Science from the Paul D. Camp Community College and was awarded a U.S. patent
for a real estate financial software product. He is currently working at Outsite
Networks Inc. in Norfolk, Virginia. He lives in Suffolk, Virginia with his lovely wife,
Lucia, and his two sons, Kaide and Wyatt.

I would like to thank my wife for her support while writing this
book, and my sons for reminding me the importance of being
inquisitive. I would also like to thank Packt Publishing for asking
me to participate as a technical reviewer in this excellent resource
on RabbitMQ.

Ignacio Colomina Torregrosa is a technical engineer in Telecommunications


and has a master's degree in Free Software. He works as a PHP/Symfony developer
and he has experience using RabbitMQ as a tool to optimize and improve the
performance of web applications that deal with a large amount of traffic.
Héctor Veiga is a software engineer specializing in real-time data integration.
Recently, he has focused his work on different cloud technologies such as AWS,
Heroku, OpenShift, and so on to develop scalable, resilient, and high-performing
applications to handle high-volume real-time data in diverse protocols and formats.
Additionally, he has a strong foundation in messaging systems knowledge such
as RabbitMQ and AMQP. Also, he has a master's degree in Telecommunications
Engineering from the Universidad Politécnica de Madrid and a master's degree in
Information Technology and Management from the Illinois Institute of Technology.

He currently works at HERE as a part of Global Data Integrations and is actively


developing scalable applications to consume data from several different sources.
HERE heavily utilizes RabbitMQ to address their messaging requirements. In
the past, he worked at Xaptum Technologies, a company dedicated to M2M
technologies. He has also reviewed RabbitMQ Cookbook written by Sigismondo Boschi
and Gabriele Santomaggio, Packt Publishing.

I would like to thank my family and friends for their support.


Specially, I would like to acknowledge my family in Chicago: David,
Pedro, Javier, Jorge, Daniela, Gerardo, and Jaime; without them, this
would not have been possible.

You might also like