마이크로서비스는 다른 마이크로서비스에 작업 요청을 보낸다. 요청된 작업이 완료되면 성공 여부
와 관계없이 업스트림 마이크로서비스는 응답을 수신한다. 특히, 업스트림 마이크로서비스의 어떤
인스턴스도 응답을 처리할 수 있어야 한다.
이벤트 기반 상호작용
마이크로서비스는 발행한 일에 대한 사실적 진술로 생각될 수 있는 이벤트를 브로드캐스트
broadcast
한다. 다른 마이크로서비스는 관심 있는 이벤트를 수신하고 적절히 대응한다.
4.5.14.5.1
장점 장점
비동기식 논블로킹 통신을 사용하면 초기 호출을 수행하는 마이크로서비스와 호출을 수신하는
마이크로서비스(또는 마이크로서비스들)는 일시적으로 분리된다. 호출을 수신하는 마이크로
서비스가 호출과 동시에 연결될 필요는 없으며, 이는
2
장에서 논의한 시간적 비결합에 대한 우
려를 피한다는 것을 의미한다(
2
.
3
.
1
절의 ‘시간적 결합에 대한 간략한 정리’ 참고).
주문 처리기
패키지 발송
<<요청>>
패키지 발송됨
<<응답>>
응답은 몇 시간
또는 며칠 후에 받는다
창고
그림
4-5
주문 처리기는 주문 패키징 및 발송 프로세스를 비동기식 방식으로 시작한다. 주문 처리기는 주문 패키징 및 발송 프로세스를 비동기식 방식으로 시작한다.
이러한 통신 방식은 호출에 의해 트리거되는 기능을 처리하는 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month, and much more.
O’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
I wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
I’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
I'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.