liveBook · Manning

Message

As explained in Microservices Patterns, Second Edition

A message is a structured unit of data transmitted between communicating software components, potentially containing headers and a payload.

A message is data exchanged between services through a message channel. It has a header of name-value metadata and a body containing the data in text or binary form. Headers can include a unique message ID and an optional return address for replies. section 8.3.1

Message roles include:

  • Document: carries data for the receiver to interpret. section 8.3.1
  • Event: reports something notable, often a domain-object state change. section 8.3.1
  • Command: requests an operation, like an RPC request. section 8.3.1

A message contract describes its structure and the channel it travels through. AsyncAPI can specify message types and schemas alongside channel names and send-or-receive direction, supporting documentation, validation, and tooling across services. section 8.3.5

Customer-created event

An AsyncAPI definition can describe a CustomerCreatedEvent published to the com.example.Customer channel, with headers and a payload schema. section 8.3.5

How Microservices Patterns, Second Edition covers it

How deep it goes
Defines headers, body, and several message roles, then connects message schemas to channel-level API contracts.
Examples
Uses document, event, and command roles, plus a CustomerCreatedEvent published on a named channel.
What you can do after
Apply it via AsyncAPI to describe message types, schemas, channels, and flow direction for service contracts.
How it connects
Connects messages to message channels, asynchronous messaging, events, commands, and AsyncAPI.

Also explained in

Compare how 10 books explain message →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Microservices Patterns, Second Edition. The section links point to the parts of the book it draws on.