Thursday, May 31, 2018

RabbitMQ and Spring Boot Integration With Fault Tolerance and Concurrency Capabilities

This article is a continuation of my previous article on asynchronous messaging using RabbitMQ. In the previous article, I explained the theoretical concept and internal mechanism of asynchronous messaging using RabbitMQ along with how to set-up to get started with it. In this article, I will mainly put emphasis on “RabbitMQ in action” part using Java and Spring Boot. To understand the high-level concept of async messaging and RabbitMQ you can visit my previous article. So, let’s look at the following aspects of this article:

  • How to integrate RabbitMQ in Spring Boot application
  • How to create producer/consumer to send/receive messages of String, JSON or Java Object
  • How to handle fault tolerance
  • How to provide concurrency

Create Spring Boot Project and Add RabbitMQ Dependencies

The first step required to make use of RabbitMQ in your application is to create a spring boot application and add the required dependencies of RabbitMQ into it. If you already have a Spring Boot application and wanted to just integrate RabbitMQ into it, then you can simply add the dependencies without creating a new project. However, creating a separate project for RabbitMQ instead of integrating into the existing project has one advantage that your message queue related code will be outside your actual application, hence, it can be easily shared or pluggable to any of your other application if required.



from DZone.com Feed https://ift.tt/2LHMXQO

No comments:

Post a Comment