liveBook · Manning

Service communication

As explained in Bootstrapping Microservices, Second Edition: With Docker, Kubernetes, GitHub Actions, and Terraform

The network interaction through which independently deployed microservices exchange information and coordinate behavior.

Service communication lets independently deployed microservices collaborate to deliver features that no single service can provide alone. It coordinates activities through direct or indirect messages. section 5.0 section 5.3

Choose the communication style according to the coordination the application needs:

  • Use direct, synchronous messaging when the sender must explicitly sequence work or orchestrate another service, and when immediate success or failure matters. HTTP POST requests support this style. section 5.11
  • Use indirect, asynchronous messaging to decouple services and broadcast important events across the application. RabbitMQ provides message queuing for this style. section 5.11
  • Treat communication as an operational concern: growing service fleets require appropriate skills, automation, and tooling to remain manageable. section 1.10.3

Video application

A video-streaming service communicates with video-storage, then a history service is added to receive a stream of messages. HTTP can coordinate a required action directly; RabbitMQ can notify other services indirectly about an event. section 5.3 section 5.11

Figure 5.2 In this chapter, we expand our application with a new microservice and explore methods of communication between our microservices.

Use the system diagram to see how adding a history microservice expands the communicating application. section 5.3

How Bootstrapping Microservices, Second Edition: With Docker, Kubernetes, GitHub Actions, and Terraform covers it

How deep it goes
Explains direct and indirect messaging with HTTP and RabbitMQ, but defers improved service-readiness handling to later treatment.
Examples
Uses video-streaming, video-storage, and history microservices to demonstrate direct requests and streams of messages.
What it assumes
Assumes a working microservices application and introduces communication techniques needed for services to collaborate.
What you can do after
Evaluate whether HTTP or RabbitMQ better fits a coordination or decoupling requirement.
How it connects
Connects microservices with HTTP, RabbitMQ, synchronous messaging, asynchronous messaging, Docker Compose, and live reload.

Also explained in

Compare how 3 books explain service communication →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Bootstrapping Microservices, Second Edition: With Docker, Kubernetes, GitHub Actions, and Terraform. The section links point to the parts of the book it draws on.