Key takeaway
- How microservices communicate: REST, gRPC and messaging compared, with API versioning, failure patterns and a sourced, step-by-step choice for architects.
Inter-process communication (IPC) in microservices is how independent services, each running as its own process and usually on different machines, exchange requests, replies and events. In a monolith, parts call each other as in-memory function calls. In a microservice architecture they must cross a network, so every call needs an agreed contract, a failure plan and a choice between direct calls and messages.
The practical choice is between two patterns described on microservices.io: remote procedure invocation (RPI), where a service calls another and waits, and messaging, where services exchange messages over channels. Most systems use both. This guide helps architects and platform leads choose per interaction, define APIs that can change safely, and handle failure. It sits alongside our guides on service-oriented architecture vs microservices and gRPC.
Which interaction style should a service use?
Start with how the caller and the receiver should behave, not with the tool. microservices.io describes five styles for messaging, and they map directly onto the older synchronous and asynchronous split:
| Style | What happens | When it fits |
|---|---|---|
| Request/response | The sender expects a prompt reply. | Checking a fact before continuing, such as whether an account is active. |
| Notification | The sender sends a message and does not expect a reply. | Telling another service that something started. |
| Request/asynchronous response | A reply is expected, but not promptly. | Work that takes time, where the caller should not block. |
| Publish/subscribe | A message goes to zero or more recipients. | Several services react to one business event. |
| Publish/asynchronous response | A request is published and some recipients reply. | Asking many services for input and collecting what comes back. |
Most services combine styles. In the example on microservices.io, an order service publishes an Order Created event when it creates an order, and other services react to it. A request that needs an answer now can still use request/response beside it. Source: microservices.io, Messaging.
Should services call each other directly or use messaging?
The two patterns trade simplicity against coupling. Read from the pattern pages on microservices.io:
| Option | Benefits | Drawbacks | Current status |
|---|---|---|---|
| Remote procedure invocation (REST, gRPC, Apache Thrift) | Simple and familiar. No intermediate broker. | Usually only request/reply. Client and service must both be running for the whole interaction. Clients must discover instances. | Established. Pair with a circuit breaker and service discovery. |
| Messaging (for example Apache Kafka, RabbitMQ) | Loose runtime coupling. A broker buffers messages until the consumer can process them. Supports several styles. | Adds a broker that must be highly available. Request/reply style is more complex. | Established. Used by the saga and CQRS patterns. |
Sources: Remote Procedure Invocation and Messaging on microservices.io. A sensible default is direct calls for questions that need an answer now, and messages for events that several services care about.
Which IPC technologies do enterprises choose from?
Technology choice follows the style. REST over HTTP models resources and is described by the OpenAPI Specification, which defines a standard, language-agnostic interface to HTTP APIs. gRPC uses protocol buffers as its interface definition language by default and supports four call kinds, as set out in the gRPC core concepts.
| Technology | Style | Contract | Note |
|---|---|---|---|
| REST over HTTP | Request/response | OpenAPI | Familiar to most teams and easy to test. |
| gRPC | Request/response and streaming | Protocol buffers | Four call kinds: unary, server streaming, client streaming, bidirectional streaming. |
| Apache Kafka | Publish/subscribe and event streams | Topic and event schema | Events in a topic can be read as often as needed, unlike traditional messaging systems, according to its docs. |
| RabbitMQ | Messaging | Queue and message definitions | Named on microservices.io as a message broker example. Confirm features on the official page. |
Kafka describes itself as publishing, storing and processing streams of events, with topics partitioned across brokers (Apache Kafka introduction). If you need a front door for external callers, see our guide to the KrakenD API gateway.
How do you define and change a service API without breaking callers?
A service API is a contract between a service and its callers, so write it first and review it with the teams that will call it. For HTTP, describe it in OpenAPI. For message-driven services, AsyncAPI is an open source initiative that aims to make working with event-driven architectures as approachable as working with REST APIs (see asyncapi.com). For gRPC, the schema is the protobuf file.
You cannot force every caller to upgrade at once, so plan for old and new versions to run together. Additive changes are the safe default. The protobuf guide says adding fields is wire-safe, that field numbers must never be reused, and that you must reserve the number of a deleted field. Changing the number of an existing field is not safe. For HTTP APIs, one common approach is to put a version in the URL and support the older version for an agreed period.
How do you handle failure between services?
A distributed call can fail in ways a function call cannot. These patterns from microservices.io cover the common cases:
| Problem | Pattern | What it does | Trade-off |
|---|---|---|---|
| A slow or failing service drags callers down | Circuit breaker | Calls go through a proxy that trips after consecutive failures, fails fast, then lets a few test requests through. | Timeout values are hard to choose without false positives or extra latency. |
| A duplicate message arrives | Idempotent consumer | The consumer records processed message IDs and discards duplicates. | Needs a place to store the IDs. |
| A database update and a message must both happen | Transactional outbox | The message is written to an outbox table in the same transaction, and a relay forwards it to the broker. | The relay may publish more than once, so consumers must be idempotent. |
| A business transaction spans services | Saga | A coordinated sequence of local transactions, with compensating transactions if a step fails. | No automatic rollback and no isolation between concurrent sagas. |
A saga can use choreography, where each service publishes events that trigger others, or orchestration, where a central orchestrator tells participants what to do. Sources: Circuit Breaker, Idempotent Consumer, Transactional Outbox and Saga. Our guides to Istio service mesh and microservices testing cover how to apply and verify these controls.
What changes when AI agents call your services?
AI agents that act on enterprise systems end up calling the same services your applications call, so the IPC contract matters more, not less. The same disciplines apply: an explicit API contract, a deadline on every call, idempotent handling of retries, and a record of what was called and why. ElixirClaw is an agentic OS platform to build, orchestrate and govern AI agents and automation workflows while keeping humans in control, and Elixir Govern (formerly AgentGRC) keeps autonomous agent actions inside policy, with the audit trail risk teams need.
This is our design view, not a vendor benchmark: treat each agent as another caller with its own identity, limits and audit trail, and expose only the operations it should use. ElixirData Context OS keeps governed context, versioned policy and decision traces in one decision layer above AI agents.
What is a sensible adoption sequence, and when should you not split a service?
- List the interactions between services and label each by style: request/response, notification, publish/subscribe.
- Choose direct calls where the caller needs an answer now, and messaging where several services react to an event.
- Write the contract first (OpenAPI, AsyncAPI or protobuf) and agree a versioning rule.
- Add deadlines, a circuit breaker and idempotent handling before going to production.
- Add tracing and tests for each link, then review which calls AI agents may make.
Do not introduce a broker for a single, simple call between two services owned by one team. Do not split a service if every request needs several synchronous calls to answer; the network cost and failure modes may outweigh the benefit. For Java teams, see Spring Boot microservices on Kubernetes.
To map one decision your agents should make across services, and the context and policy it depends on, book a Context Workshop. See what happens in the workshop.
Frequently asked questions
What is inter-process communication in microservices?
It is how services running as separate processes exchange requests, replies and events over a network, using direct calls such as REST or gRPC, or messages through a broker such as Apache Kafka or RabbitMQ.
Should microservices use synchronous or asynchronous communication?
Use synchronous request/response when the caller needs an answer now, and asynchronous messaging when several services react to an event. microservices.io notes that synchronous calls need both sides running, while a broker buffers messages until the consumer is ready.
How do you change a microservice API without breaking callers?
Prefer additive changes, keep old versions running for an agreed period, and follow the schema rules of your format. For protobuf, never reuse field numbers and reserve the numbers of deleted fields.
How do you stop one failing service taking down others?
Put a deadline on every call and use a circuit breaker, which fails fast after a threshold of consecutive failures and then tests recovery with a few requests.
How should AI agents call microservices?
As any other caller: through the documented API, with limits, idempotent retries and an audit trail. This is a design recommendation, not a measured result.
Follow XenonStack on LinkedIn: XenonStack on LinkedIn for new guides on agentic AI, data and platform engineering.
Explore the XenonStack platform family: ElixirData · ElixirClaw · ElixirHub · NexaStack · MetaSecure · Neural AI · AgentGRC · AgentSRE · AgentAnalyst · AgentInstruct · AgentRAI · AgentScrum · AgentSearch · AgentForce · AI Aviator · SAIF Aviator · CohortIQ · XenonStack AI · XenonStack UAE