liveBook · Manning

Retry

As explained in Microservices Patterns, Second Edition

A retry mechanism is logic that repeats a failed operation to recover from transient failures.

A retry repeats a failed operation to recover from a transient failure. It is useful when a service makes synchronous calls, where delivery guarantees cannot be delegated to a message broker. section 10.2.5 section 8.2.4

In an HTTP-based saga, a communication failure leaves the orchestrator in its current state. After a timeout, it tries that state again. Make participant endpoints idempotent so a duplicate request can return the original response. section 10.2.5

Figure 10.16 The state machine for a saga orchestrator that invokes the participants using HTTP. HTTP responses trigger state machines. If there’s a communication failure, the state is unchanged and a transition to the same state occurs after a timeout.
orchestration http state machine

See how an HTTP communication failure keeps the saga state unchanged until a timeout triggers another attempt. section 10.2.5

Retries can also be applied to synchronous provider calls in API composition. They are one resilience option alongside circuit breakers, time limits, and bulkheads; use them as part of a broader strategy for unavailable or slow providers. section 12.3.3 section 8.2.4

How Microservices Patterns, Second Edition covers it

How deep it goes
Shows a saga state remaining unchanged after HTTP failure and retrying after a timeout, but does not specify retry limits.
Examples
Illustrates retries with failed HTTP calls in a Create Order Saga and optional provider calls in API composition.
What you can do after
Apply retries to synchronous saga participant requests or API-composition provider calls.
How it connects
Connects retries with synchronous request/response, saga orchestration, circuit breakers, and API composition.

Also explained in

Compare how 25 books explain retry →

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.