Message hubs (RabbitMQ)

If you have never come across the concept of microservices or message hubs before, you may be somewhat daunted by what is coming next. Don't be. Message hubs and microservices are designed to make it easier to connect, route, and troubleshoot issues with multiple services that need to talk to one another. As such, these systems are designed to be easy to set up, and easier to use. Let's see how easy it is to set up an excellent message queue platform called RabbitMQ in the next exercise:

  1. Navigate your browser over to https://www.rabbitmq.com/#getstarted.
  2. Download and install RabbitMQ for your platform. There is typically a download button near the top of the page. You may be prompted to install Erlang, as follows:
Erlang warning dialog
  1. Erlang is a concurrent functional programming language and perfect for writing messaging hubs. If you don't have it on your system, just download and install it, again for your platform; next, restart the RabbitMQ installation.
  1. For the most part, follow the installation choosing the defaults, except for the installation path. Make sure to keep the installation path short and memorable, as we will want to find it later. An example of setting the path in the installer for Windows as follows:


Example of setting the installation path on Windows

  1. RabbitMQ will install itself as a service on your platform. Depending on your system, you may get a number of security prompts requesting firewall or admin access. Just allow all these exceptions, as the hub needs full access. When the installation completes, RabbitMQ should be running on your system. Be sure to check the documentation for your platform if you have any concerns on the configuration or setup. RabbitMQ is designed to use secure communication but keeps itself fairly open for development. Please avoid installing the hub in a production system, and expect to do some security configuration.
  1. Next, we want to activate the RabbitMQ management tool so that we can get a good overview of how the hub works. Open up a Command Prompt and navigate to the RabbitMQ installation server folder (the one marked server). Then navigate to the sbin folder. When you are there, run the following command to install the management plugin (Windows or macOS):
rabbitmq-plugins enable rabbitmq_management
  1. An example of how this looks in a Windows Command Prompt follows:


Installing the RabbitMQ management plugin

That completes the installation of the hub on your system. In the next section, we will see how to inspect the hub with the management interface.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset