> ## Content Index
> Fetch the complete content index at: https://www.karls.io/llms.txt
> Use this file to discover other available public pages before exploring further.

# Micro services. Direct vs indirect communication.
- URL: https://www.karls.io/micro-service-communication-patterns/
- Published: 2021-08-24T19:00:00.000Z
- Updated: 2024-01-02T20:30:49.000Z
- Author: Karl Scerbiakas
- Tags: Microservices

Micro services is a fun in itself. Here are tips when to use messaging over direct HTTP communication.

### When to use HTTP:

- Need to message service directly
- Requires a confirmation about success or failure of the request/message
- Message order matters. Need for message sequencing.
- Need for a microservice orchestration. For example API gateway.

### When to use indirect communication:

- Requirement to broadcast message in all application. Whether message is handled does not matter.
- Loose coupling. Enables change and development of each service separately.
- Performance. Sender can emit messages, but receiver will process them at its own pace.
- Requirement for no lost messages. Messages will be resent until processed by receiver.
- Parallel processing. Multiple subscriptions from a single topic.
- If subscribing service is offline, once it will become available it will process messages.