It is only used in case of transaction errors, which are usually not going to work on second try if they failed once.
Unless I am missing something, it should always be better to simply add these items to the failure queue instead of immediately trying to repeat the import.
And by dropping this loop, I can remove a lot of boiler plate code here and inline the whole consumeRecord function/module.
What do you think?
monkey
Hi kellnerd ! Yes I had looked at the comment in question suggestion to drop it.
I'm not sure what the possible failure modes are going to be, but I agree it doesn't make a lot of sense to retry on any failure, expecting another failure. Indeed I think this is for the failureQueue to deal with. I am all for simplifying code and removing asynchronous loops where possible which usually make the code more brittle
Assuming `TRANSACTION_ERROR` errors won't be less of an error if we retry with the same record
kellnerd
Yeah, currently it is hard to see which error type and message is caused by what unless you open consumer.ts and consumeRecord.ts side by side.
I've been refactoring these messages to have less redundancy and it was a bit hard to follow what happens...