Error handling with Spring Cloud Stream
The score application we developed in the previous recipe has become critical for football matches as it manages the final match score. For that reason, we need to ensure the solution’s robustness.
Spring Cloud Stream can implement highly available, loosely coupled, resilient systems. The reason is that the underlying messaging systems, such as RabbitMQ, provide different mechanisms to ensure the message is delivered to the intended destination. First, the messages can be queued before they are delivered. If, for any reason, the consumer application is not ready yet or has a transient failure, it will process the queued messages once it’s ready again. You can use the same mechanism to increase the number of consumers to increase the throughput of your system. You can also configure a retry policy in case of a transient failure in your application or forward it to a special queue, which is named a dead-letter queue (DLQ). The...