LEARNING RABBITMQ
WITH C#
By
SAINESHWAR BAGERI
FIRST EDITION 2019
Copyright BPB Publications, INDIA
ISBN: 978-93-88176-94-1
All Rights Reserved. No part of this publication can be stored in a retrieval system or reproduced in any form or by any means without the prior written permission of the publishers.
LIMITS OF LIABILITY AND DISCLAIMER OF WARRANTY
The Author and Publisher of this book have tried their best to ensure that the programmes, procedures and functions described in the book are correct. However, the author and the publishers make no warranty of any kind, expressed or implied, with regard to these programmes or the documentation contained in the book. The author and publisher shall not be liable in any event of any damages, incidental or consequential, in connection with, or arising out of the furnishing, performance or use of these programmes, procedures and functions. Product name mentioned are used for identification purposes only and may be trademarks of their respective companies.
All trademarks referred to in the book are acknowledged as properties of their respective owners.
Distributors:
BPB PUBLICATIONS 20, Ansari Road, Darya Ganj New Delhi-110002 Ph: 23254990/23254991 DECCAN AGENCIES 4-3-329, Bank Street, Hyderabad-500195 Ph: 24756967/24756400 | BPB BOOK CENTRE 376 Old Lajpat Rai Market, Delhi-110006 Ph: 23861747 MICRO MEDIA Shop No. 5, Mahendra Chambers, 150 DN Rd. Next to Capital Cinema, V.T. (C.S.T.) Station, MUMBAI-400 001 Ph: 22078296/22078297 |
Published by Manish Jain for BPB Publications, 20, Ansari Road, Darya Ganj, New Delhi-110002 and Printed by Repro India Ltd., Mumbai
Preface
Learn Rabbitmq with C# is meant for developers, architects, solution providers, consultants, and engineers to develop solutions using RabbitMQ message queueing with.Net Applications.
RabbitMQ is an open source and cross-platform message broker which Implements AMQP protocol and is lightweight and easy to deploy on-premises or in the cloud. It is built on Erlang which is also used by WhatsApp for messaging. RabbitMQ provides a way to exchange data between applications such as a message sent a Node.js application, or Java application can read the from.Net application.
In a fast-paced world where the applications need to provide fast responses to the end user, we develop Bussiness Web applications in the form of portals and also use same to send Emails, Messages, Notifications to ends Users slowing down the performance of the application. Using Rabbitmq, we can remove this burden from the Portal by using Exchanges and Queues for handling Messages and Notifications.
RabbitMQ is a Magical Tool for the IT world.
Acknowledgements
I'd like to thank the following people:
To my parents for supporting and encouraging me.
To Manish Jain for providing me with the opportunity to write this book.
To Shivprasad Koirala and Sukesh Marla for supporting and encouraging me to write this book.
And to all the other people who played a role in getting this book ready. Thanks for your hard work!
RabbitMQ Introduction
What is RabbitMQ?
RabbitMQ is an AMQP message broker, it is the most popular open source and cross-platform message broker.
It is built on Erlang which is also used by WhatsApp for messaging.
RabbitMQ is also a way to exchange data between applications such as a message sent from .Net application can be read by a Node.js application or Java application.
RabbitMQ is lightweight and easy to deploy on premises and in the cloud. It supports multiple messaging protocols. RabbitMQ can be deployed in distributed and federated configurations to meet high-scale, high-availability requirements.
Why and when should we use RabbitMQ?
We should use RabbitMQ because it is open source and easy to use with many languages such as .Net, Java, Python, Ruby, Node Js.
We can use RabbitMQ to remove some heavy work from our web application such as sending Reports in Emails, in Excel or Pdf format's or sending email, SMS or another task such as a trigger to some other applications to start processing.
Nowadays most people do all this task into single application sending emails or SMS, reports which bit heavy task which is also handled by IIS if you separate this task then IIS will get more space (memory) to serve more request.
After understanding a bit about RabbitMQ next we are going to Install Erlang and RabbitMQ on Windows.
What is AMQP?
The Advanced Message Queuing Protocol (AMQP) is an open standard application layer protocol for message-oriented, the defining features of AMQP are message orientation, queuing, routing (including point-to-point and publish-and-subscribe), reliability and security.
It was developed by JPMorgan and iMatix Corporation.
Key Features
AMQP was designed with the following main characteristics as goals:
Security
Reliability
Interoperability
Standard
Open
Various Client Libraries
RabbitMQ support various number of operating systems and various language and it has various clients for different languages such as:
1..Net
2. Java
3. Spring Framework
4. Ruby
5. Python
6. PHP
7. Objective-C and Swift
8. JavaScript
9. GO
10. Perl
RabbitMQ Setup
In this part, we are going to learn how to setup RabbitMQ step by step:
1. What is Erlang
2. Downloading Erlang
3. Installing Erlang
4. Downloading RabbitMQ
5. Installing RabbitMQ
6. Starting RabbitMQ Server
7. Enabling web management plugin
8. Web Management plugin
9. Conclusion
What is Erlang
Erlang is a general-purpose programming language and runtime environment.
Erlang has built-in support for concurrency, distribution, and fault tolerance.
Erlang is used in several large telecommunication systems from Ericsson.
Referred from: Referred from: http://erlang.org/faq/introduction.html
Link to download Erlang
http://www.erlang.org/downloads
After downloading Erlang now, we are going to install Erlang.
Installing Erlang
In this part, just click on Erlang setup which you have downloaded to install.