I am working with a .Net Core application that is receiving data from a Kafka Message. We are taking the data and then sending it to a Stored Proc so that the Tables in the db can be updated. There is a Policy retry handler that is being used that when the Stored Proc is called and if there is an error, then we put the message into a Dead Letter Queue and retry if need be.
However, as I previously said, I am wanting to add an extra message on top of the error message that comes back from Sybase. The following is the code that is being used to execute the function that eventually calls the Stored Proc:
try
{
.Handle<TException>(ex => !ex.IsInvalidDataException())
.WaitAndRetryAsync(Settings.MaxRetryAttempts,
retryAttempt => TimeSpan.FromSeconds(Math.Pow(2, retryAttempt))
, (exception, timeSpan, retryCount, context) =>
{
// Logging to Azure
});
})
.ExecuteAsync(func);
}
catch (Exception exception)
{
// Extra code to determine what needs to happen to the message that was received
}
If the data that is sent to the Stored Proc causes an error for some reason then it shows a message from Sybase of what the error is.
However I am wanting to add a custom message to the message that I am already receiving and was wondering how that might be done.