liveBook · Manning

Request message

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

An HTTP POST request is an HTTP request that submits data to a server for processing or resource creation.

An HTTP POST request sends a message directly from one microservice to another. The sender receives a direct response, so it can immediately determine whether handling succeeded or failed. section 5.7 section 5.11

A request identifies its destination with a hostname and route, such as http://history/viewed. DNS resolves the hostname to the target service's private IP address; Docker Compose supplies this behavior automatically, while Kubernetes deployment requires additional configuration. section 5.7.3 section 5.7.2

A minimal direct message has these parts:

  • The sender creates the request with Node.js's built-in http library, sets method: POST, and declares application/json when sending a JSON payload. section 5.7.3
  • The sender serializes the payload, writes it to the request, ends the request, and handles success and error callbacks separately. section 5.7.3
  • The receiver exposes an Express POST route, reads the parsed payload from req.body, performs its operation, and returns an HTTP status. section 5.7.4

Viewed-message flow

When a user starts watching a video, the video-streaming service sends a POST request to http://history/viewed with a videoPath value. The history service extracts req.body.videoPath, stores it in its database, and responds with status 200. section 5.7.3 section 5.7.4

Upload pipeline

A browser uses fetch to POST a video to the gateway. The gateway forwards the stream to video-upload, which forwards it to video-storage; storage uploads the stream to Azure and returns success. The frontend updates its UI or displays an error. section 10.7.6

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

How deep it goes
Explains sender, receiver, payload, routing, status handling, and streaming examples without detailing HTTP protocol internals.
Examples
Demonstrates viewing-history messages, browser video uploads, gateway forwarding, and streaming uploads to Azure Storage.
What it assumes
Assumes basic HTTP and microservice familiarity while teaching payload handling, service addressing, and direct request flow.
What you can do after
Apply it via Node.js HTTP, Express, fetch, and Axios to send, receive, forward, and troubleshoot direct service messages.
How it connects
Connects HTTP POST with microservices, direct messaging, DNS, Express, JSON, asynchronous messaging, RabbitMQ, and cloud storage.

Also explained in

Compare how 14 books explain request message →

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.