Harian, and welcome back now in today's We Do will be discussing about the excuse that later use now
the Amazon excuse supports did later accuse which other cues, which are basically the source cues,
can target for the messages that can be processed or consumed successfully.
So let's understand this with an example.
So let's assume that this is a skierski that you have.
And along with this, you have a lamda function which acts as a consumer.
So this lamda function basically goes ahead and it fetches the messages that are part of the skew askew
and it processes them after the process is completed, it delete the message from the original skyscape.
However, due to some reason, the forceful messages have been successfully processed, but only the
fifth message.
It was able to fit it, but it was not able to process that message due to some reason.
So now what will happen is that this fifth message continues to be part of the queue, primarily because
the lambda function is not able to successfully process this specific message so that it can later delete
it.
So since this processing is not completed, this fifth message continues to stay in the excuse queue.
And whatever other processes that are fitting the messages from this queue, this message will always
lead to an error.
So in order to overcome this, you have a feature of a dead letter.
Q So the concept is that if there is a message that the consumer processors are not able to successfully
process it, move, the message to another Kukali is a dead letter.
Q So this fifth message is now moved from the source.
Q To another Google is a dead letter.
Q And then the developer can manually go ahead and inspect the message from the date later due to understand
on why exactly things are not working so the troubleshooting area can happen from the dead letter.
Q So this is the basics of the concept of that letter.
Now let's go ahead and look into it in a practical way.
So currently with the Security Council and we have to use that are available, when is the message?
Q And the second one is the dead letter to another message.
Q is configured in such a way that a maximum amount of receives is two.
So after the messages received for more than two times, it is assumed that there is an issue with the
message, primarily because the consumer is getting the message, but it is not able to process and
hence that message will be moved to the date later.
Q So let's go ahead and try it out so I'll send a message here.
So I just call it as this is a message to one.
All right, I'll go ahead and send a message now before we go ahead and configure it.
Let me quickly show you the settings.
So within the dead letter.
Q You're the maximum received that you see is two, so we'll be able to get it to times.
So let's go ahead and receive the message.
So I'll fall for the message.
And as soon as we were able to pull, you see the receive count became one.
So if I quickly open the message you have, this is a message one.
So at this stage things seems to be fine.
Let's go ahead and pull once more time.
And now again, you see, after the second pulling the receive count now has become to now at this stage,
if will quickly go to the Q and refresh the page, the message available is still one.
So the message has not gone to the dead letter.
Q It will only go when it is being created for the third time.
So now let's go ahead and receive the message for the third time.
So now if you'll do a poll for message this time, you will not see a message, primarily because the
receive count has been increased to three and because of our configuration setting.
The message now went from the message due to the new red letter to.
So now a very fresh debate.
You see, the message available in our queue is zero and the message that is part of the dead letter
to you is one.
So now all the developer needs to do is that from their day later, he needs to go ahead and fall for
the message.
And this time he'll be able to look into the message and troubleshoot on why the consumer prices were
not able to complete the processing on this message.
So this is the basic concept behind that letter.
You know, in fact, let me quickly show you on how we can go ahead and create a day later.
So first, let's create a queue.
So I just call it as queue one.
And Al Gore didn't create a cue alert.
Let's go back to the queue so we have one similarly.
Let's go ahead and create a Q two and let's call it a day later.
We'll go ahead and we'll create a Q Perfect.
So at this stage, we only have a standard Q type.
So the dead letter configuration needs to be configured in the Q1.
So when you go ahead and click on EDIT, you have the option of that letter.
Q So we'll go ahead and enable this.
And the Q Target this time would be are you do that later on.
So this is the letter.
Q And the maximum received here, let's just call it is too similar to what we were using Endemol.
I conceive perfect.
So now let's go ahead and send a message.
I just got a text message so um let's do a send.
Mrs. Buffett.
So the message has been sent if we go ahead and double the receive count is No.
One.
Let's poll again that receive count is now two and now let's poll again.
And now you see the message no longer appears within the source.
Q So let's stop the polling here and let's go back.
So if you see it, there are only two cues that are appearing.
In fact, this would be fixed if you manually do a refresher.
This is one of the issues with the Security Council.
This is a newer console.
Maybe it might be fixed after some amount of time.
But let's refresh this.
And this time you see the message available is zero in the Q one.
And within the Q of that letter, you have a message available that is one.
That's great.
So I hope at a high level or do you understand the basics of that letter?
You know, before we conclude that a few important points that we need to remember first one is that
when a message moves to a dead letter, Q There's a timestamp remains unchanged.
This is very important.
So let's understand this for an example.
So let's see a message that has been within the source.
Q For one day has now moved to a dead letter.
You now the message retention period within the dead letter Q is four days, so after four days the
message would be deleted.
So this first message which had been within this walls for one day and has now moved to the dead letter.
Q The message will only stay within the dead letter two for three days and after three days it will
be deleted primarily because the original timestamp of the message remains to be the same.
So although the retention of the dead letter is four days since the message was already there in source.
Q For one day it can stay in the dead letter for a maximum of three days now.
So it is considered as a best practice to always have a higher retention period for a dead letter due
than that of the source.
Q That's correct.
So this will conclude today's video.