Communcation style pattern
Remote Procedure Invocation
Messaging
Domain-specific protocol
Remote Procedure Invocation (RPI): context
You have applied the Microservice architecture pattern. Services must handle requests from the application’s clients. Furthermore, services must sometimes collaborate to handle those requests. They must use an inter-process communication protocol.
Remote Procedure Invocation (RPI): solution
Use RPI for inter-service communication. The client uses a request/reply-based protocol to make requests to a service.
Remote Procedure Invocation (RPI): example
REST
gRPC
Apache Thrift
Remote Procedure Invocation (RPI): result benefits
Remote Procedure Invocation (RPI): result drawbacks
Remote Procedure Invocation (RPI): result issues
Client needs to discover locations of service instances
Remote Procedure Invocation (RPI): related
The Domain-specific protocol is an alternative pattern
The Messaging is an alternative pattern
Externalized configuration supplies the (logical) network location, e.g. URL, of the service.
A client must use either Client-side discovery and Server-side discovery to locate a service instance
A client will typically use the Circuit Breaker pattern to improve reliability
Messaging: context
You have applied the Microservice architecture pattern. Services must handle requests from the application’s clients. Furthermore, services must sometimes collaborate to handle those requests. They must use an inter-process communication protocol.
Messaging: solution
Use asynchronous messaging for inter-service communication. Services communicating by exchanging messages over messaging channels.
Messaging: examples
There are numerous examples of asynchronous messaging technologies
Apache Kafka
RabbitMQ
Messaging: result benefits
Messaging: result drawback
Additional complexity of message broker, which must be highly available
Messaging: result issues
Request/reply-style communication is more complex
Messaging: related
Messaging: related
Enterprise Integration Patterns - a comprehensive set of message patterns
The Event Tram framework, which implements transaction messaging for microservices
Domain-specific protocol: context
You have applied the Microservice architecture pattern. Services must handle requests from the application’s clients. Furthermore, services must sometimes collaborate to handle those requests. They must use an inter-process communication protocol.
Domain-specific protocol: solution
Use a domain-specific protocol for inter-service communication.
Domain-specific protocol: example
There are numerous domain-specific protocols including:
Domain-specific protocol: related
* The RPI pattern is an alternative pattern