liveBook · Manning

Direct messaging

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

Direct messaging is synchronous communication in which one microservice sends a message directly to a specifically addressed other microservice and receives an immediate handling result.

Direct messaging is synchronous communication in which one microservice sends a message to one specifically addressed microservice and receives an immediate response. Messages usually act as commands that trigger an action, although they can also notify the recipient of an event. section 5.6.1 section 5.6

Use direct messaging when the sender needs explicit control over the interaction:

  • Address one microservice by name and confirm immediately whether message handling succeeded or failed. section 5.11
  • Sequence subsequent messages after an earlier operation completes. section 5.9
  • Let a controller microservice orchestrate a defined order of behavior across several other microservices. section 5.7.6

Recording a viewed video

A video-streaming microservice sends a “Viewed” message directly to the history microservice. The sender addresses that recipient explicitly and learns immediately whether the message was handled successfully. section 5.6.1 section 5.7.7

Figure 5.9 Direct messaging allows one controller microservice (here, Microservice A) to orchestrate complex behaviors across multiple other microservices.

The orchestration diagram helps trace how one controller microservice coordinates multiple recipients through direct responses. section 5.7.6

Direct messaging makes message order and control easy to follow, but couples the sender tightly to a single recipient. Central orchestration can also create a single point of failure: a controller crash may leave a complex operation inconsistent or unfinished. Indirect messaging is preferable when decoupling, broadcasting, or independently paced services matter more. section 5.7.7 section 5.9

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

How deep it goes
Defines the interaction, demonstrates HTTP use and orchestration, and stops short of detailed protocol or reliability internals.
Examples
Uses an HTTP POST “Viewed” message from a video-streaming microservice to a history microservice.
What it assumes
Assumes familiarity with microservices and HTTP requests while introducing direct-versus-indirect communication terminology.
What you can do after
Apply it via HTTP POST requests to command a named microservice, inspect immediate results, and sequence coordinated behavior.
How it connects
Connects microservices, HTTP, synchronous communication, orchestration, indirect messaging, RabbitMQ, and coupling.

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.