마이크로서비스 아키텍처 전체에 다양한 협업 스타일이 혼재될 수 있으며, 이것은 지극히 일반
적이라는 점을 주목해야 한다. 어떤 상호작용은 요청 및 응답으로만 이뤄지지만, 어떤 상호작
용은 이벤트 중심으로 이뤄지기도 한다. 사실 단일 마이크로서비스가 하나 이상의 협업 형태
를 구현하는 것은 일반적이다. 예를 들면 주문하거나 변경하고 나서 이벤트를 발생시키는 주문
(
Order
) 마이크로서비스가 있다.
그럼 이러한 다양한 통신 방식을 좀 더 자세히 살펴보자.
4.44.4
패턴
동기식 블로킹동기식 블로킹
동기식 블로킹 호출을 사용하면, 마이크로서비스가 일종의 호출을 다운스트림 프로세스(아
마도 다른 마이크로서비스)에 보내고 호출이 완료돼 응답이 수신될 때까지 대기한다. [그림
4
-
2
]에서 주문 처리기(
Order
Processor
)는 고객 계정에 포인트를 추가해야 한다는 것을 알
리려고 멤버십(
Loyalty
) 마이크로서비스에 호출을 보낸다.
주문 처리기
포인트 부여
응답을 기다리며 대기한다
멤버십
그림
4-2
주문 처리기는 멤버십 마이크로서비스에 동기식 호출을 보내고 응답을 받을 때까지 대기한다. 주문 처리기는 멤버십 마이크로서비스에 동기식 호출을 보내고 응답을 받을 때까지 대기한다.
일반적으로 동기식 블로킹 호출은 ...
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.