liveBook · Manning

Message

As explained in Grokking Software Architecture

A message is a structured unit of information exchanged between software components or distributed systems.

A message carries information between software services without requiring them to handle it at the same time. In event-driven systems, distinguish a command—which asks for action—from an event, which records a fact. section 7.0

A message may pass through four handoffs:

  • Publication: the producer gives the message to a broker and receives confirmation. section 7.4.3
  • Enqueue: the broker stores it so it can wait safely for a consumer. section 7.4.3
  • Consumption: a consumer retrieves the message, typically locking it while processing. section 7.4.3
  • Acknowledgment: after successful processing, the consumer confirms completion; without that confirmation, the broker may retry. section 7.4.3

An order message

The Order Service publishes an OrderPlaced event. The broker stores it, then the Shipping Service consumes it and prints a label. If shipping crashes before acknowledging, the broker can resend the message—so the label might be printed twice. section 7.4.3 section 7.2.3

Figure 7.3 The Broker acts as the buffer. The Producer speaks to the Broker, not the Consumer.

See how a broker buffers messages between producers and consumers. section 7.2.1

How Grokking Software Architecture covers it

How deep it goes
Traces publication, persistence, consumption, and acknowledgment, including retries and duplicate processing.
Examples
Uses an OrderPlaced event, shipping-label processing, and RabbitMQ, Kafka, and AWS messaging services.
What you can do after
Understand how a message moves through a broker and why failed acknowledgments can trigger duplicate work.
How it connects
Connects message flow to event-driven architecture, publish-subscribe, brokers, and at-least-once delivery.

Also explained in

Compare how 10 books explain message →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Grokking Software Architecture. The section links point to the parts of the book it draws on.