Популярное

Музыка Кино и Анимация Автомобили Животные Спорт Путешествия Игры Юмор

Интересные видео

2025 Сериалы Трейлеры Новости Как сделать Видеоуроки Diy своими руками

Топ запросов

смотреть а4 schoolboy runaway турецкий сериал смотреть мультфильмы эдисон
dTub
Скачать

Spring Cloud Session 4 Inter Microservice Communication ASynchronous using RabbitMQ

Автор: Balaji Sankar Chopparapu

Загружено: 2020-09-12

Просмотров: 2871

Описание:

In this tutorial we are going to learn how microservices communicate with each other in asynchronous fashion. In asynchronous communication calling microservice will not wait till the called microservice responds. This pattern can be achieved with message bus infrastructures like Kafka or RabbitMQ.Here we use Spring Cloud Stream framework to communicate with message bus.
Git : https://github.com/balajich/spring-cl...

Overview

When report-api microservice receives a request to get employee details it is going to fetch details and write results to message bus.
Mail microservice listens on the bus for employee details and when those details are available on bus. It is going to read send SMS and email.
report-api play a role of Producer
mail-client microservice plays a role of Consumer
RabbitMQ play a role of mediator or message bus
Flow

Run RabbitMQ server, it binds to port 5672 and admin ui application to port 15672.
Run registry service on 8761.
Run employee-api service on dynamic port. Where it takes employee id and returns employee name.
Run payroll-api service on dynamic port. Where it takes employee id and returns employee salary.
Run report-api service on dynamic port. Where it takes employee id and returns employee name and salary by directly communicating with employee-api and payroll-api. It also publishes employee details to message bus
Run mail-client service (it is not a rest api, it a java process and doesnt bind to any port). Where it subscribes to message bus for employee details message and sends mail,sms.
Run Gateway service on 8080 and reverse proxy requests to all the services (employee-api,payroll-api,report-api)
All the microservices (employee-api,payroll-api,report-api,gateway) when they startup they register their service endpoint (rest api url) with registry
Gateway Spring Cloud load balancer (Client side load balancing) component in Spring Cloud Gateway acts as reverse proxy. It reads a registry for microservice endpoints and configures routes.
Important Notes

Netflix Eureka Server plays a role of Registry. Registry is a spring boot application with Eureka Server as dependency.
Netflix Eureka Client is present in all the micro services (employee-api,payroll-api,report-api,gateway) and they discover Eureka server and register their availability with server.
Generally Netflix Ribbon Component is used as Client Side load balancer, but it is deprecated project. We will be using Spring Cloud Load balaner in gateway
RabbitMQ Terminology
Producer, publisher A Producer is the application that is sending the messages to the message queue.
Consumer A Consumer is the application that receives the messages from the message queue.
Message queue- A message queue is a queue of messages sent between applications. It allow applications to communicate by sending messages to each other.
Exchange An exchange is responsible for the routing of the messages to the different queues. An exchange accepts messages from the producer application and routes them to message queues with help of header attributes, bindings, and routing keys
Ack When RabbitMQ delivers a message to a consumer, it needs to know when to consider the message successfully sent. An ack will acknowledge one or more messages, which tells RabbitMQ that a message/messages has been handled
Binding A binding is a "link" that you set up to bind a queue to an exchange.
Channel A channel is a virtual connection inside a connection. When you are publishing or consuming messages from a queue - it's all done over a channel.
Connection-A connection is a TCP connection between your application, and the RabbitMQ broker
Spring Cloud Stream Concepts
Spring cloud stream abstracts underneath communication with Messagebus. This helps to foucs on business logic instead of nettigritty of message bus. We can easily switch from RabbitMQ to Kafka etc without code changes.

Bindings — a collection of interfaces that identify the input and output channels.
Channel — represents the communication pipe between messaging-middleware and the application.
StreamListeners- Listens to messages on Input channel and serializes them to java objects.

Source Code
https://github.com/balajich/spring-cl...

Spring Cloud Session 4 Inter Microservice Communication ASynchronous using RabbitMQ

Поделиться в:

Доступные форматы для скачивания:

Скачать видео mp4

  • Информация по загрузке:

Скачать аудио mp3

Похожие видео

Spring Cloud Session 5 Microservices Documentation

Spring Cloud Session 5 Microservices Documentation

The Man Behind Google's AI Machine | Demis Hassabis Interview

The Man Behind Google's AI Machine | Demis Hassabis Interview

Koronka do Miłosierdzia Bożego, Msza św., Godzina Miłosierdzia, Różaniec, Sanktuarium w Łagiewnikach

Koronka do Miłosierdzia Bożego, Msza św., Godzina Miłosierdzia, Różaniec, Sanktuarium w Łagiewnikach

Я в опасности

Я в опасности

Resilience4j Building Fault Tolerant REST API

Resilience4j Building Fault Tolerant REST API

Spring Cloud Session-4 Inter Microservice Communication ASynchronous using Kafka

Spring Cloud Session-4 Inter Microservice Communication ASynchronous using Kafka

Resilience4j  Session 1 Limit of number of requests to RESTAPI using ratelimiter

Resilience4j Session 1 Limit of number of requests to RESTAPI using ratelimiter

Cała prawda o Danii! Miśko: To co robili na Grenlandii było straszne!

Cała prawda o Danii! Miśko: To co robili na Grenlandii było straszne!

1985: The Year Feelings Meant Something 💿 | Synthwave • Retrowave • Dreamwave Mix

1985: The Year Feelings Meant Something 💿 | Synthwave • Retrowave • Dreamwave Mix

Silny mróz do końca stycznia. Mroźny luty. Bardzo zimne trendy na kolejne tygodnie.

Silny mróz do końca stycznia. Mroźny luty. Bardzo zimne trendy na kolejne tygodnie.

Zbrojenia Bez Hamulców: Pół Miliona Żołnierzy, Rekord Wydatków i „Bilet do Wojska” dla tysięcy

Zbrojenia Bez Hamulców: Pół Miliona Żołnierzy, Rekord Wydatków i „Bilet do Wojska” dla tysięcy

Can You Name What You're Looking For?

Can You Name What You're Looking For?

How to Escape Google Surveillance: Replace Every Service in 2 Weeks

How to Escape Google Surveillance: Replace Every Service in 2 Weeks

Why Everyone Stopped Using Dropbox

Why Everyone Stopped Using Dropbox

Europa vs. USA! Będzie wojna o Grenlandię? To koniec NATO? — Marek Budzisz i Piotr Zychowicz

Europa vs. USA! Będzie wojna o Grenlandię? To koniec NATO? — Marek Budzisz i Piotr Zychowicz

I Just Purchased $100,000 In Duolingo Stock - Here’s Why $DUOL Will Make Millionaires

I Just Purchased $100,000 In Duolingo Stock - Here’s Why $DUOL Will Make Millionaires

Spring Cloud Session 2 Microservices Dynamic ports

Spring Cloud Session 2 Microservices Dynamic ports

Calm Mind Focus Music 4K 🎵 Deep Chillout for Long Study & High Retention

Calm Mind Focus Music 4K 🎵 Deep Chillout for Long Study & High Retention

Cinematic Meditative Soundscapes | Interstellar Echos from Planet LYMYA

Cinematic Meditative Soundscapes | Interstellar Echos from Planet LYMYA

Najlepszy i Najgorszy Film Każdego Studia Animacji

Najlepszy i Najgorszy Film Każdego Studia Animacji

© 2025 dtub. Все права защищены.



  • Контакты
  • О нас
  • Политика конфиденциальности



Контакты для правообладателей: infodtube@gmail.com