Senior
What did you do with invalid messages after manual processing? How did it look technically?
sobes.tech AI
Answer from AI
After manual processing of invalid messages, the following approach was usually applied:
- Logging and analysis: messages were stored in a separate repository (for example, in a database or files) to understand the cause of the error.
- Correction: errors in the data were corrected manually or with scripts.
- Resending: corrected messages were placed back into the queue or processing system for reprocessing.
Technically, it looked like this:
- The message processing system had a separate channel or queue for invalid messages (dead-letter queue).
- After manual review and correction, messages were sent back to the main queue via API or CLI.
An example in Go (simplified):
func reprocessMessage(msg Message) error {
if err := validate(msg); err != nil {
return err
}
// Send the message back to the queue
return messageQueue.Publish(msg)
}
Thus, data quality control was ensured and reprocessing was possible without data loss.