Skip to content

Commit

Permalink
fixed bug if retry count is 1
Browse files Browse the repository at this point in the history
  • Loading branch information
Hoomanfr committed May 31, 2022
1 parent b0868ab commit 744472d
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions pkg/consumer_factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,11 @@ func CreateConsumer[T handler.IMessage](bus IBus, handler handler.IHandler[T]) {
panic(formatter.FormatErr(methodPath, err))
}
nextRetryQueue = retryQueue
if i == 1 {
firstQueue := queue.NewQueue(bus.Connection(), msgPath, handlerPath)
firstConsumer := consumer.NewConsumer(bus.Connection(), handler, firstQueue, retryQueue, errQueue, 0)
err = firstConsumer.Consume()
if err != nil {
panic(formatter.FormatErr(methodPath, err))
}
}
}
firstQueue := queue.NewQueue(bus.Connection(), msgPath, handlerPath)
firstConsumer := consumer.NewConsumer(bus.Connection(), handler, firstQueue, nextRetryQueue, errQueue, 0)
err = firstConsumer.Consume()
if err != nil {
panic(formatter.FormatErr(methodPath, err))
}
}

0 comments on commit 744472d

Please sign in to comment.