Customizing messages pushed to error queue on system exceptions

Wondering if there is an option to customize my original message and send to the error queue when there are exceptions.
ex: I receive an event with 100 items in it. I processed 80 items and 81 got failed. Since automatic retries are enabled, the message goes to the error queue and comes for re-processing. Problem is i try to reprocess the first 80 messages again. Is there a way to customize the message to put only failed items in the event for reprocessing.

Why not sending 100 commands to process 1 single item to yourself in response to the event. Then each of the commands can be retried without affecting the other ones. If needed, the overall progress can be tracked by a saga that is started by the event.

1 Like

To add to Marc his good suggestion, splitting in individual messages also allows for concurrent processing where each individual item that is being processed will just be a small transaction if it would require to access a database.