Skip to content

Commit

Permalink
feat: make unknown topic or partition error fatal (#87)
Browse files Browse the repository at this point in the history
* feat: make unknown topic or partition error fatal
  • Loading branch information
mhmtszr committed Apr 17, 2024
1 parent 3ddae8b commit 0149b0d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion kafka/producer/producer_batch.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,9 @@ func (b *Batch) FlushMessages() {

func isFatalError(err error) bool {
e, ok := err.(kafka.Error)

if ok && errors.Is(err, kafka.UnknownTopicOrPartition) {
return true
}
if (ok && e.Temporary()) ||
errors.Is(err, io.ErrUnexpectedEOF) ||
errors.Is(err, syscall.ECONNREFUSED) ||
Expand Down

0 comments on commit 0149b0d

Please sign in to comment.