Draft: add first code draft to manage eventual kafka errors
Similar code has been already ported to the bullseye-wikimedia and bookworm-wikimedia branches but the current implementation broke tests. With this patch tests passes as expected and can be improved to support other critical and non-critical errors and retries.
Bug: T354712 Bug: T334078