liveBook · Manning

Chapter 8: Interprocess communication in a microservice architecture

What you will learn in chapter 8 of Microservices Patterns, Second Edition

The introduction explains why interprocess communication is central to microservices and why choosing an IPC mechanism is an architectural decision.

After this chapter you will be able to

What it builds on

Section by section

Introduction

The introduction explains why interprocess communication is central to microservices and why choosing an IPC mechanism is an architectural decision.

Key terms: interprocess communication (IPC), service collaboration patterns, process boundaries, IPC mechanism, availability, performance, runtime coupling, transaction management

8.1 Overview of interprocess communication in a microservice architecture

This section introduces the main communication mechanisms and message payload formats available to microservices before turning to their design details.

Key terms: synchronous request/response, asynchronous, message-based communication, message brokers, message payload formats, human-readable, text-based formats, compact binary formats

8.1.1 Interaction styles

Classifies client-service interaction styles and explains why the style should be chosen before an IPC technology.

Key terms: interaction style, IPC mechanism, availability, one-to-one, one-to-many, synchronous, asynchronous, request/response, asynchronous request/response, one-way notifications

8.1.2 Defining APIs in a microservice architecture

This section explains how to define reliable service API contracts using interface definitions, API-first collaboration, and shared style conventions.

Key terms: service API, network-based contract, HTTP, messaging, Interface Definition Language (IDL), Open API, AsyncAPI, compatibility checks, API-first, interface definition

8.1.3 APIs have Service Level Objectives (SLOs)

The section explains how measurable API quality targets, observability, and error budgets turn operational promises into decisions about service reliability and delivery.

Key terms: service level indicator, service level objective, service level agreement, software quality attributes, observability, instrumentation, telemetry, SLI, SLO, error budget

8.1.4 API Security

This section explains three distinct API security concerns: protecting communication, verifying callers, and controlling their access.

Key terms: secure communication, Transport Layer Security (TLS), data in transit, authentication, access tokens, OAuth 2.0 bearer tokens, JSON Web Tokens (JWTs), identity claims, authorization, role-based access control

8.1.5 Evolving APIs

This section explains why service APIs need controlled evolution and how versioning, compatibility practices, and automated checks help prevent breaking clients.

Key terms: API, clients, rolling upgrade, Semantic Versioning, MAJOR.MINOR.PATCH, REST API, messaging, backward-compatible changes, major, incompatible changes, side-by-side API

8.1.6 Message payload formats

Explains how message payload formats affect interoperability, efficiency, API usability, and schema evolution, comparing text formats with Protocol Buffers and Avro.

Key terms: IPC, message payload format, cross-language message payload format, Java serialization, JSON, XML, self-describing, JSON Schema, backward-compatible, text-based message format

8.1.7 Developing API clients

This section explains how API clients represent exchanged messages and compares four implementation strategies by effort, correctness, type safety, and design-time coupling.

Key terms: API client, Data Transfer Objects (DTOs), serialization, deserialization, projection, development effort, correctness, type safety, design-time coupling, untyped data model

8.2 Communicating using the synchronous remote procedure invocation pattern

Introduces synchronous remote procedure invocation (RPI) as a request–response way for a client to communicate with a service, and traces the request through client and server adapters.

Key terms: remote procedure invocation, RPI, request, response, proxy interface, RPI proxy adapter class, RPI server adapter class, business logic

8.2.1 Benefits and drawbacks of RPI

This section weighs RPI’s familiar, direct request/reply model against its runtime coupling, limited interaction styles, and need for service discovery.

Key terms: Remote Procedure Invocation (RPI), request/reply, message broker, runtime coupling, high latency, resiliency patterns, interaction styles, event streaming platform, service discovery, network location

8.2.2 Using REST

Explains how REST APIs use resources and HTTP, how to define and evolve their contracts, and where REST is useful or awkward in a microservice architecture.

Key terms: resource, HTTP verbs, REST maturity model, HATEOAS, OpenAPI Specification, OpenAPI document, IDL, API contract, REST API style guide, microservice chassis

8.2.3 Using gRPC

This section explains how gRPC defines and implements service APIs, how those APIs evolve, and when gRPC is a useful alternative to REST.

Key terms: gRPC, Protocol Buffers-based IDL, protoc, client-side stubs, server-side skeletons, backward-compatible changes, numeric field tags, breaking change, major version number, REST/JSON

8.2.4 Implementing resilient synchronous communication

This section explains how services making synchronous calls can limit the effects of downstream latency and failure, and still return useful responses when possible.

Key terms: runtime coupled, SLOs, resiliency patterns, Bulkhead, Cache, Circuit breaker, Fallback, Rate limiter, Retry, closed state

8.2.5 Using service discovery

The section explains why dynamic service locations require discovery, how application-level and platform-provided discovery work, and why platform-provided discovery is usually preferred.

Key terms: service discovery, service registry, service instance, network location, Self registration pattern, Client-side discovery pattern, load-balancing algorithm, 3rd party registration pattern, Server-side discovery pattern, registrar

8.3 Communicating using the asynchronous messaging pattern

Introduces asynchronous messaging between services, its brokered and brokerless forms, and three client interaction styles.

Key terms: messaging, message broker, brokerless architecture, asynchronous request/reply, one-way notification, publish/subscribe

8.3.1 Overview of messaging

This section explains how messages move between services through channels, what messages and channels contain or do, and the benefits and costs of asynchronous messaging.

Key terms: sender, receiver, message channel, sending port, message sender adapter, message handler adapter, header, message body, document, event

8.3.2 Implementing the interaction styles using messaging

This section shows how messaging implements four service interaction styles using message channels, replies, and correlation IDs.

Key terms: asynchronous request/response, command message, reply channel header, correlation id, message identifier, one-way notifications, point-to-point channel, publish/subscribe, domain events, publish-subscribe channel

8.3.3 Designing an asynchronous messaging architecture

This section explains how to design message channels by defining their requirements first, then choosing a broker whose channel model and trade-offs fit.

Key terms: message channel, messaging technology, technology-agnostic, channel type, delivery guarantees, message ordering, competing consumers, persistence, durability, queues

8.3.4 Evolving an asynchronous API

Explains how persistent messages affect asynchronous API compatibility and how to evolve event and command/reply APIs without breaking consumers.

Key terms: persistent, message channels, older versions, event, attribute, default value, JSON, ProtoBuf, AVRO, dual publishing

8.3.5 AsyncAPI - an IDL for messaging-based APIs

This section explains how AsyncAPI describes a service’s asynchronous messaging contract and how tools can generate, validate, and use that description.

Key terms: AsyncAPI, IDL, messaging APIs, machine-readable contract, channels, messages, operations, headers schema, payload schema, CustomerCreatedEvent

8.3.6 Pattern: Ordered competing receivers

This section explains how sharded message channels let multiple receivers increase throughput while preserving the order of messages for a particular entity.

Key terms: message receivers, message ordering, point-to-point channel, sharded (partitioned) channels, shard key, consumer group, orderId

8.3.7 Pattern: Idempotent consumer pattern

This section explains why messaging consumers receive duplicates and how idempotent handlers or message-ID tracking prevent duplicate effects.

Key terms: at-least-once delivery, exactly-once delivery, acknowledging, duplicate messages, idempotent, message handler, ordering, redelivering messages, message id, PROCESSED_MESSAGES

8.3.8 Pattern: Transaction outbox

This section explains how the transactional outbox reliably records messages alongside database changes, then compares polling and transaction-log tailing for publishing those messages.

Key terms: Transactional outbox pattern, OUTBOX table, MessageRelay, local ACID transaction, NoSQL databases, list of messages, pending events, Polling publisher pattern, destination message channel, Transaction log tailing pattern

8.3.9 Synchronously invoking an asynchronous implementation

This section explains when a synchronous HTTP endpoint can respond while the requested operation is carried out through asynchronous messages, and the trade-offs of each choice.

Key terms: HTTP response, final outcome, runtime coupled, latency, availability, PENDING, order ID, partial outcome, runtime coupling, poll

8.3.10 Libraries and frameworks for messaging

This section explains why the book uses Eventuate for messaging and how its basic and higher-level APIs relate to messaging patterns.

Key terms: message broker’s client library, higher-level library or framework, Eventuate platform, MessageProducer, MessageConsumer, Transaction outbox pattern, Eventuate CDC service, Idempotent consumer pattern, DomainEventPublisher, domain events

8.4 Summary

Where this is used later

Concepts explained in this chapter

← Chapter 7: The Microservice architecture: enabling fast sustainable flow Chapter 9: Implementing system commands with sagas →

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.