Spring RabbitMQ Retry And Error Handling Example

Table of Contents Introduction What Is Dead Letter Queue Prerequisites Project Setup Application Properties Custom Exception Producer or Sender Consumer or Receiver Config Class Spring Boot Main Class Testing RabbitMQ Dead Letter Queue Source Code Introduction In this example I am going to show you how to retry the failed messages in RabbitMQ message broker. So, here I am going…

Spring Boot RabbitMQ RPC Example

Table of Contents Introduction Callback Queue Message Properties Correlation Id Prerequisites Project Setup Application Properties Configuration Server Client Main Class Output – Testing RPC Source Code Introduction In this tutorial, I am going to show you how to create Spring Boot RabbitMQ RPC Example. RPC is an acronym which stands for Remote Procedure Call, in which a function is executed…

Spring Boot RabbitMQ Message Pattern Example

Table of Contents Introduction Topic Exchange Prerequisites Project Setup Application Properties Sender Receiver Configuration Main Class Testing Message Pattern Source Code Introduction In this tutorial I am going to show you how to build Spring Boot RabbitMQ message pattern example with TopicExchange. FanoutExchange is only capable to broadcast messages to all receivers and it has limitations to send messages selectively. The DirectExchange can allow you…

Spring RabbitMQ Routing Example

Table of Contents Introduction Direct Exchange Prerequisites Project Setup Application Properties Configuration Sender Receiver Spring Boot Main Class Testing RabbitMQ Routing Application Source Code Introduction In this Spring RabbitMQ Routing example I am going to show you how to route messages to particular subscribers. Therefore, all receivers are not going to receive all messages, but a subset of messages. A…

Spring Boot RabbitMQ Publish Subscribe Example

Table of Contents Introduction Exchanges Prerequisites Project Setup Sender Receiver Exchange Name Configurations Spring Boot Main Class Testing Rabbitmq Publish Subscribe Source Code Introduction Here I am going to build an example about publish subscribe model using Spring Boot and RabbitMQ message broker. In publish subscribe model the messages will be delivered to multiple consumers. In this example I am…

Spring Boot RabbitMQ Work Queues Example

Table of Contents Introduction Prerequisites Application Properties Producer Consumer Configuration Spring Boot Main Class Testing Work Queues Task Queues Source Code Introduction Here in this example I am going to show you how to build work queues or task queues using Spring Boot framework and RabbitMQ broker. Work queues are used to distribute time-consuming tasks among multiple workers. The idea…

Spring Boot RabbitMQ Producer Consumer Example

Table of Contents Introduction Prerequisites Project Setup Application Properties Producer Consumer Configuration Spring Boot RabbitMQ Main Class Testing Producer Consumer Application Source Code Introduction In this tutorial I will show you how to build producer consumer example using Spring Boot and RabbitMQ. This is also called point-to-point messaging model as there are only one producer or sender and only one…

RabbitMQ – access to vhost ‘xyz’ refused for user ‘guest’

Problem Let’s say you are starting your Spring Boot application and your (Spring Boot) application is trying to connect to vhost (virtual host) ‘xyz’ that does not exist in RabbitMQ server. So, you are getting error – access to vhost ‘xyz’ refused for use ‘guest’. By default, the user which is used to connect to RabbitMQ is ‘guest’. Here the vhost ‘xyz’ is not the…

Fix RabbitMQ Startup Errors After Installation

Introduction In this tutorial I am going to explain about few common startup problems or errors of RabbitMQ server after a fresh installation. I am using 3.6.1 version of the RabbitMQ message broker. RabbitMQ Startup Errors You might have faced the following errors during starting the RabbitMQ message broker after installation in your system. Starting broker… completed with 0 plugins….

Microservices Asynchronous Communication – Push Notifications

Introduction The example I will show you here about the asynchronous communication among microservices or how microservices communicate asynchronously among themselves. A microservices-based application is a distributed system running on multiple processes or services, usually even across multiple servers or hosts. Each service instance is typically a process. Therefore, services must interact using an inter-process communication protocol such as HTTP…