watermill-kafka
watermill-kafka copied to clipboard
Set context for copied message on retry
Sets the context for the message copy when it is retried.
The problem is that currently if a handler fails to process a message - it is copied, but without a context. That might result in the errors in the handler if it waits for the partition, offset or message timestamp fields in the context, which are set here https://github.com/ThreeDotsLabs/watermill-kafka/blob/b03a4f48517c6afd50b3b1de4d89faa57faf971f/pkg/kafka/subscriber.go#L546-L548
Context is created here and set for the original message https://github.com/ThreeDotsLabs/watermill-kafka/blob/b03a4f48517c6afd50b3b1de4d89faa57faf971f/pkg/kafka/subscriber.go#L556-L558