Remote calls can fail, or hang without a response until some timeout limit is reached. If there are multiple callers on a unresponsive supplier, then you can run out of critical resources leading to cascading failures across multiple system.
For instance, in the happy flow below service A does some business logic, saves some data to a DB and then sends an audit message to RabbitMq which will be used for logging purposes. The broker is up and running and after the message is delivered (not consumed yet), service A continues its work doing other tasks.

When RabbitMQ is down, service A cannot send the message and until the message is delivered, it just hangs, trying to retry sending the message. Even though messaging is a ‘fire-and-forget’ mechanism, the publisher must still deliver the message to RabbitMQ. That delivery requires network communication and if the broker is down, the publish call can block.

One solution to this problem is to use a retry mechanism, with exponential back-off.
This solution might work for transient failures, maybe after one or two retries, the broker gets back up and can acknowledge the messages.
But what if we go a little further and consider the case when these failures are not transient? And RabbitMQ is down for a long period of time?
In these scenarios we have two other patterns that can help us:
- Circuit breaker – will prevent a service from repeatedly trying to execute an operation that is likely to fail
- Outbox (will be tackled in a later post) – can be used to save events to a persistent storage so they will not be lost
Below is how CB can help the system become more resilient, by switching between three states: Closed, Half-Open and Open.


Below is a half-open state when CB tries to call RabbitMq to check if it’s up and running and if it is, then it will close the circuit.

Conclusions:
- Instead of letting publish calls block or retry indefinitely, the circuit breaker opens and immediately returns an error/fallback. This gives predictable latency to callers and avoids cascading slowdowns.
- Resources were protected and overloads were prevented
- By reducing load during failure periods, the broker and network have a better chance to recover
- When open, producers can apply a fallback: persist to local durable storage (DB, disk), write to an alternate queue/transport, emit an event to an offline handler, or return an appropriate error (e.g., 503) to upstream clients.




3. Create the intents using DialogFlow console – the intents can be found 











