Principles of Software Designing
It is very easy to build a software or app. But, it is trickier to have a good…
August 23, 2022
First, lets understand a simple workflow in event-driven systems or in messaging workflow.
Lets consider a failure scenario, where the the format of message is unknown and the consumer throws an exception, without acknowledging or negative acknowledgement.
The message goes back to the original queue, and is available for next consumption.
There are three ways to handle the failure case:
Note: We can not lose any message, so every message is important to the system.
Now when one worker fails by saying that I didn’t understand the format. It is mostly likely, it will be fail next time as well.
Now, think of a case that you are rejecting something, and it is coming back to you again infinitely!
In computer terms, we are wasting the resources and actually doing DDOS
our own systems, which is bad.
The idea behind pushing in a Dead-Letter-Exchange queue is that someone will manually handle the messages, and would probably push it back to original queue after some modification, or code change in workers. Or, may be we will delete the message if its not important or gets produced by mistake.
But, its a manual step! But, this saves our services from DDOS
attack.
Remember, what we do in a normal Exponential Backoff retries. We retry after some random time sleep, and we keep on increasing this sleep time exponentially.
The idea is same. We will have a separate retry
queue for every such queue present in our system.
Let me list the steps:
Expiration
or TTL
metadata.retry
queue and sent back to original queue. And, its back to be processed again.
Hope it helps.
It is very easy to build a software or app. But, it is trickier to have a good…
What is a Singleton Pattern Following constraints are applied: Where we can…
Exponential Backoff in Rabbitmq Please make sure to read first, why we need the…
Introduction In this post we will see following: How to schedule a job on cron…
Introduction There are some cases, where I need another git repository while…
Introduction In this post, we will see how to fetch multiple credentials and…
Introduction I have an automation script, that I want to run on different…
Introduction I had to write a CICD system for one of our project. I had to…
Introduction Java log4j has many ways to initialize and append the desired…